Closed Halofreak1990 closed 2 years ago
This is an issue for me as well.
This works:
POST https://myserver/mypath/myoperation HTTP/1.1
content-type: application/x-www-form-urlencoded
f=json&inputLocations=123,45;123,46
But this doesn't:
POST https://myserver/mypath/myoperation HTTP/1.1
content-type: application/x-www-form-urlencoded
f=json
&inputLocations=123,45;123,46
FYI, I found that changing DocumentParser.cs, line 263 from:
currentRequest.Body += prevEmptyLine + item.Text;
to:
currentRequest.Body += prevEmptyLine + item.TextExcludingLineBreaks;
fixes the problem for me.
When building a request body with ContentType application/x-www-form-urlencoded, I usually place each parameter on a new line for readability, like so: param1=value1 ¶m2=value2 ¶m3=value3 ...
This works just fine in RESTClient for VSCode, but here, it sends the newlines as part of the parameter values, leading to 400 (Bad Request) errors when POST-ing to the server, as it does not expect newlines.