Einzelnen Beitrag anzeigen

Ykcim

Registriert seit: 29. Dez 2006
Ort: NRW
848 Beiträge
 
Delphi 10.4 Sydney
 
#10

AW: CURL in Delphi ausführen -d

  Alt Gestern, 14:49
@uwe Raabe
Vielen Dank, dass habe ich verstanden. Das poDoNotEncode hatte ich bereits hinzugefügt.

Zitat:
Request.Params.AddItem('accept', 'application/json', pkHTTPHEADER, [poDoNotEncode]);
Request.Params.AddItem('content-type', 'application/x-www-form-urlencoded', pkHTTPHEADER, [poDoNotEncode]);
kannst du noch durch diese ersetzen:
markierenDelphi-Quellcode:
Request.Aaccept := 'application/json';
{ Das Setzen des ContentType kann entfallen (s.u.) }
Das werde ich mal ausprobieren. Ich habe viel zu wenig Ahnung, wie die Kommunikation bei REST-Abfragen über das Internet technisch funktioniert. Hast Du da eine gute Quelle, wo ich mir einen Überblick verschaffen kann?

@Kas Ob
Many thanks for your answer and the explanation. I have not CURL installed jet. I tried by CMD. What I do not understand is the fact, that the Query of the CURL by CMD gives an error: 400 Bad Request. I upload a screenshot of the cmd window. When I check the exact same CURL by https://reqbin.com/curl I get the right result. Unfortunately the first 4 hours I tried by cmd only...

I will check how to read the header and body of the request before executing.
Many thanks

Patrick
Miniaturansicht angehängter Grafiken
fehler_curl_token.jpg  
Patrick

Geändert von Ykcim (Gestern um 17:18 Uhr)
  Mit Zitat antworten Zitat