XF English Dictionary

FREEMIUM
Verified
Por XF Innovations | Actualizada 24 दिन पहले | Data
Popularidad

9.4 / 10

Latencia

794ms

Nivel de servicio

100%

Health Check

N/A

Volver a todas las conversaciones

Need a delphi sample code.

Rapid account: Arlsenglish 01 O Nb Vbeo 7 T 6
arlsenglish01-ONbVbeo7T6
एक वर्ष पहले

Can you make a Delphi sample code using the following?

httpReq:= CreateOleObject(‘WinHttp.WinHttpRequest.5.1’);

I keep getting an error message.
"No mapping for the Unicode character exists in the target multi-byte code page."
My delphi is 10.4.

Thanks.

Rapid account: Arlsenglish 01 O Nb Vbeo 7 T 6
arlsenglish01-ONbVbeo7T6 Commented एक वर्ष पहले

[Here is my code]

httpReq:= CreateOleObject('WinHttp.WinHttpRequest.5.1');
hr:= httpReq.Open('post','https://xf-english-dictionary1.p.rapidapi.com/v1/dictionary', false);
httpReq.setRequestheader('content-type','application/json');
httpReq.setRequestheader('X-RapidAPI-Host','xf-english-dictionary1.p.rapidapi.com');
httpReq.setRequestheader('X-RapidAPI-Key','xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

str1 := '{"selection":"successfully"';
str2:= ',"textAfterSelection" : "completed their project."';
str3:= ',"textBeforeSelection" : "They"}';

str := str1+str2+str3;
if hr= S_OK then HttpReq.Send(str);

If HttpReq.Status = 200 Then begin
   showmessage(HttpReq.responsetext);
end;

Únase a la conversación, añada un comentario a continuación:

Inicie sesió/Regístrese para publicar nuevos comentarios