XF English Dictionary

フリーミアム
よって XF Innovations | 更新済み 17 days ago | Data
人気

9.4 / 10

レイテンシー

681ms

サービスレベル

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;

ディスカッションに参加しましょう-以下にコメントを追加してください:

ログイン/サインアップして新しいコメントを投稿