XF English Dictionary

FREEMIUM
Verified
(Ким) XF Innovations | Оновлено a month ago | Data
Популярність

9.4 / 10

Затримки

804ms

Рівень обслуговування

100%

Health Check

N/A

Повернутися до всіх обговорень

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;

Приєднуйтесь до обговорення — додайте повідомлення нижче:

Вхід / Реєстрація, щоб публікувати нові повідомлення