Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
algonzalez opened this issue May 13, 2022 · 2 comments
Open

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

algonzalez opened this issue May 13, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@algonzalez
Copy link

algonzalez commented May 13, 2022

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 algonzalez added the bug Something isn't working label May 13, 2022
@algonzalez
Copy link
Author

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

@FrancWest
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants