XF English Dictionary

FREEMIUM
Verified
By XF Innovations | Updated 5 days ago | Data
Popularity

9.4 / 10

Latency

53ms

Service Level

100%

Health Check

N/A

Back to All Discussions

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;

Join in the discussion - add comment below:

Login / Signup to post new comments