Steps to Reproduce:
Using the steps provided by the example
POST http://api.example.com/userupload HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file[0]"; filename="sample.xml"
Content-Type: application/xml
< C:\sample.xml
------WebKitFormBoundary7MA4YWxkTrZu0gW--
The actual content of the xml file sent is "< C:\sample.xml". It is not getting evaluated and the contents of the file are not piped in instead.
@wboyle-erwin I can't reproduce this in my env, and does this file C:\sample.xml really exists in your system? You can verify this by Ctrl+Click the file name in editor, if exists, it will open the file in a new tab
sample.xml is just a sample statement. the actual file is different that i am trying to use. however, ctrl + click actually does nothing in my environment. the keybinding does not look to be defined.
was able to get ctrl + click enabled by enabling http mode with ctrl k, then m. Currently trying to figure out why it states "Unable to open 'xml file name': resource is not available" even though the location has the file.
making a path similar to file:///C:/sample.xml makes the ctrl+click resolve but still doesn't work
@wboyle-erwin can you test whether escape the \ will work, like C:\\sample.xml or C:/sample.xml
@wboyle-erwin could you please help to test the work around mentioned above?
Here is a post of the REST client snippet I have tried. Clicking the link (file:///) below seems to find the file in question. However, I get "failed to open stream: No such file or directory". Which to me seems like this is not sending any of the contents of the file with the request body.
POST https://dev.myerwin.io/dm/api/erwin-import HTTP/1.1
Authorization: Basic wboyle Testing123
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file[0]"; filename="sample_descriptions.xml"
Content-Type: application/xml
< file:///C:/Users/WilliamBoyle/Documents/sample_descriptions.xml
------WebKitFormBoundary7MA4YWxkTrZu0gW--
I have also tried the following:
< C:/Users/WilliamBoyle/Documents/sample_descriptions.xml
< C:\\Users\\WilliamBoyle\\Documents\\sample_descriptions.xml
Same error as above.
@wboyle-erwin When you click the link (file:///), can you really open/find the file, in my test (finally on a windows machine), I can't repro your issue(even with no escape), but my code has bug in Ctrl+Click of file links(in non file:/// scheme).
with 0.15.2
Clicking the following provides an error now:
< file:///C:/Users/WilliamBoyle/Documents/sample_descriptions.xml
Clicking the following works now:
< C:/Users/WilliamBoyle/Documents/sample_descriptions.xml
The end result of Ctrl + Alt + R is the same unfortunately and doesn't pipe the contents of the file into the request body.
@wboyle-erwin could you please sent the request to this url https://requestb.in/190tr451, and I will check the actual request you sent to server. Sorry for the incovenience
Sure. I sent the request.
@wboyle-erwin as you can see here, your sent request seems already contains the xml file content in request body.

Inspecting the request body, i am not seeing the ending WebKitFormBoundary. Is there a limit to how much is sent?
Do you mean you inspect your request body on your server side or the site I asked you to request for?
I had the same problem.
@ozh555 could you please provide me some details about your OS and sample request, thanks in advance.
@Huachao
os: windows7 64
vsvode: 1.19.1
@ip = http://127.0.0.1:8080
POST {{ip}}/server/app
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="json"
{
"username":"123456"
}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="1.xml"
Content-Type: application/xml
< D:\123.xml
------WebKitFormBoundary7MA4YWxkTrZu0gW--
@ozh555 thanks, could you also temporarily set the request url to https://requestb.in/1lx73751, and trigger a request, so that I can confirm your sent out request. Sorry for the inconvenience.
@ozh555 as you can see here, sent out request already contains the XML content
@Huachao
Wow! It's true.
Maybe my server went wrong! But I use Postman can work,I do not know where is wrong。
@ozh555 it still can be a bug of my code, could you please show me the error response before yo u dig into your server side code?
And another way to verify is that, you also send the request to https://requestb.in/1lx73751 in Postman, so that I can inspect the request difference between postman and mine. Thanks in advance
@ozh555 except different boundaries, once difference I found is the Content-Type is different, mine is application/json and another is text/xml. So will you server work, if you change your request to text/xml of the file
@ip = http://127.0.0.1:8080
POST {{ip}}/server/app
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="json"
{
"username":"123456"
}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="1.xml"
Content-Type: text/xml
< D:\123.xml
------WebKitFormBoundary7MA4YWxkTrZu0gW--
@Huachao
Still can't work.
and vscode had problem:

@ozh555 so the server didn't respond? Can postman still work now? Sorry for bothering you again and again
yes, server didn't respond.
postman work all the time.
@ozh555 it's really strange, I will inspect this later when I have a Windows environment. One last thing, if you change back to application/xml, will the server respond in time? Thanks.
It's still the same.
@ozh555 what do you mean __same__ here? Does that mean if we revert to application/xml, the server can respond but not the expected response? Or since you use my extension, the server always don't return(just hang there)?
server always don't return。
and vscode always waiting。
@ozh555 what's your server side stack(language + framework)?
Java-springmvc
@ozh555 could you please to try again with latest version 0.17.0?
@wboyle-erwin does this problem still exists in 0.17.0?
@Platzer could you please to try again with latest version 0.17.0? Can you still repro
If no one can repro this issue, I'd like to close it now, please feel free to reopen it
I think this bug has since been fixed.
I'm not sure whether I'm encountering the same bug.
Recently , when I post a file, it waits there , hangs and and never returns . However, if I send a payload in application/json format, this extension works as expected.
For example, I post an image as below:
POST https://eastus.api.cognitive.microsoft.com/face/v1.0/detect?returnFaceLandmarks=true&returnFaceAttributes=age,gender HTTP/1.1
Ocp-Apim-Subscription-Key: xxxx
Content-Type: application/octet-stream
< ./images/celebrities/gutianle-3.jpg
However, the same code worked flawlessly last month. I'm pretty sure there's nothing wrong with the server side.
What I have tired
I've tried to uninstall this extension, remove the folder under ~/.vscode/extensions/humao.rest-client-0.21.1 and re-install the latest version (v0.21.1) , but none of them works.
I'm wondering does this extension write to a temp file? What should I do ?
@newbienewbie this is a known issue, and already fixed in #332 , and will publish this fix in next release
@Huachao Hi, thanks for your quick response.
Is there a known date when the next version is released ?
@newbienewbie earlier next week or later this week.
@Huachao Got it . Thanks again for your great extension 💯 !
@newbienewbie you can try the latest version to verify
@Huachao Sorry for the late response. It works now . Thanks 👍