06-21-2022, 04:05 PM
Hi,
How can i add some json into the http request body when using GET?
How can i add some json into the http request body when using GET?
JSON in Get request
|
06-21-2022, 04:05 PM
Hi,
How can i add some json into the http request body when using GET? (06-21-2022, 04:05 PM)CarlAarnes Wrote: How can i add some json into the http request body when using GET? TIdHTTP.Get() does not currently allow you to do this. While the current HTTP specs do not strictly prohibit sending a body with a GET request, they do leave it very ambiguous how servers should handle such requests, leading to a wide range of inconsistent/non-functional behaviors. That being said, if you absolutely need to include a body in a GET request (because a particular REST API requires it), you will have to call the TIdCustomHTTP.DoRequest() method directly, eg: Code: // need an accessor class because DoRequest() is protected... |
« Next Oldest | Next Newest »
|