madskristensen / RestClientVS

Other
66 stars 14 forks source link

File POST works in VS Code ext. but not this one. #30

Open algonzalez opened 2 years ago

algonzalez commented 2 years ago

Describe the bug POST call to upload a file is working in the VS Code extension but not in this one. Does not appear to be replacing the @values.

Response in Visual Studio Pro 2022 (64-bit) v17.1.5 is: "An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set."

To Reproduce @hostname = localhost @port = 44388 @host = {{hostname}}:{{port}} @baseURL = https://{{host}}

@boundary = ----demoBoundary @contentType = multipart/form-data; boundary={{boundary}}

POST {{baseurl}}/sendfile HTTP/1.1 Content-Type: {{contentType}}

--{{boundary}} Content-Disposition: form-data; name="file"; filename="jellyfish.jpg" Content-Type: application/octet-stream

< ./files/pexels-cristian-muduc-10027304.jpg --{{boundary}}--

Expected behavior The "[FromForm(Name = "file")] IFormFile file" is seen by the endpoint. It is valid when sent from VS Code, but null when sent by this extension.

algonzalez commented 2 years ago

If I hard code the variables, I get an "HTTP/1.1 400 Bad Request" with a "File not sent" message.

FrancWest commented 2 years ago

I have a similar issue. When posting the exact request in VS Code, it works fine. When using the Rest Client for Visual Studio on the same machine I get a 401 Unauthorized error.