Hi
Any suggestion how to change the content-type in a request using #XPRIM_HttpRequest from application/json to application/x-www-form-urlencoded ?
content-type application/x-www-form-urlencoded
Re: content-type application/x-www-form-urlencoded
Dino,
you could try:
#HttpRequest.Content.ContentInfo.MediaType := 'application/x-www-form-urlencoded'
If that doesnt do it,
#httpRequest.Options.AddHeader Name('Content-Type') Value('application/x-www-form-urlencoded')
might also work.
you could try:
#HttpRequest.Content.ContentInfo.MediaType := 'application/x-www-form-urlencoded'
If that doesnt do it,
#httpRequest.Options.AddHeader Name('Content-Type') Value('application/x-www-form-urlencoded')
might also work.
Re: content-type application/x-www-form-urlencoded
it works!
thank you!
thank you!
Re: content-type application/x-www-form-urlencoded
Dino,
great, but which one worked for you...
great, but which one worked for you...
Re: content-type application/x-www-form-urlencoded
The first one:
request.headers.log reports:
Code: Select all
Define_Com Class(#XPRIM_HttpRequest) Name(#Request)
(....)
#Request.Content.ContentInfo.MediaType := 'application/x-www-form-urlencoded'
#Request.DoPost Url(#Url)
----------------------------------------------------------
| | HEADER NAME | HEADER VALUE |
----------------------------------------------------------
| 1 | Content-Length | 143 |
| 2 | Content-Type | application/x-www-form-urlencoded |
| 3 | User-Agent | cpprestsdk/2.10.14 |
----------------------------------------------------------