Forum Discussion
thediez
2 years agoFrequent Visitor
How to send a POST request with an empty body
Dear All, I have been struggling with sending a POST request with an empty body to retrieve data. The request requires authentication via refresh token which is working fine. It seems that the ...
OwenAuger
2 years agoSuper User
Hi thediez
Try making this change:
body = Text.ToBinary(""),
This seemed to work for me for another API POST request.
Does this work for you?
thediez
2 years agoFrequent Visitor
Hi OwenAuger ,
Thanks for the suggestion.
I have updated as follows:
let
body = Text.ToBinary(""),
Source = Json.Document(Web.Contents("https://www.vptol.co.uk/dlatest/QuestionnaireDataWithProfile?org=whoglmat&typ=WHOData", [Headers=[#"Authorization"="Bearer "&GetAccessTokenForAcasiResponses()], Content=body]))
in
Source
But now getting this message.
I suspect that adding "Content" in the brackets after "Header" is causing this error.
Kind regards,
Khurshed