json postdata (wodHttpDLX)

by shine, (3280 days ago)
edited by unknown,

it can't actually be sent as postdata on some servers

so when i try to just plug it a custom line in headers:

.Request.Headers.Add vbNewLine & "", "{""name"":""" & value & """}"

this is what request.headers.tostring returns errors

the problem is ": " is being added, as is customary when adding traditional header entries. this results in an error from the target server. and to reiterate, traditional "postdata" cannot be used here.

someone asked this question here before and wasn't given an answer, and that was years ago. many post requests require json post data

is this possible with wodhttp?

this is pretty standard web stuff in 2016. is there really no way to fully customize post requests? there must be.

locked

json postdata

by Jasmine, (3280 days ago) @ shine

Hi.

You cannot send JSON (or any other value) like that, not through Headers.Add.

It's sufficient to set
[inlinecode]Request.Headers("Content-type").Value = "application/json"[/inlinecode]
and then in

[inlinecode]Request.Body = your_json[/inlinecode]
with formatted JSON.

I hope this helps.

Jasmine

locked

json postdata

by shine, (3280 days ago) @ Jasmine

yeah that worked. awesome.

locked