XF English Dictionary

GRATIS CON POSSIBILITÀ DI UPGRADE
Verified
Da XF Innovations | Aggiornamento a month ago | Data
Popolarità

9.4 / 10

Latenza

807ms

Livello di servizio

100%

Health Check

N/A

Torna a tutte le discussioni

Need a delphi sample code.

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 a year ago

[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;

Partecipa alla discussione - aggiungi un commento di seguito:

Accedi/Iscriviti per pubblicare nuovi commenti