AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
222 stars 20 forks source link

request timeout in vscode but works in cli #243

Closed Med-H closed 5 months ago

Med-H commented 7 months ago

when issuing the same command in cli and vscode the cli command works with no issues whereas the vscode one times out

the file looks like this

###
# @name vars
@url = https://...
@url-x-api-dev-key = some-key

###  
# @name testname
# @ref vars 
# @no-client-cert
# @no-reject-unauthorized
GET {{url}}/v1/test
X-API-KEY: {{url-x-api-dev-key}}

running with the following cli command works

httpyac ./test.http -n testname --quiet 

but the request times out when run through vscode.

AnWeber commented 7 months ago

Is a proxy possibly set in VSCode that is not active on the command line? VSCode injects a proxy for all requests. Possibly deactivate this function once with http.proxySupport=off.

Med-H commented 6 months ago

I tried it with "http.proxySupport": "off".

the request works the first time, then if i call it again it times out. whereas the cli responds in less then 1 sec. after timing out i can issue it again and it works.

btw, amazing plugin. are you also member of the cli group?

AnWeber commented 6 months ago

@Med-H Well, group is well said, most of it is from me alone. but yes, both projects belong together and I will make a MonoRepo out of it as soon as I find more time again.

Since the code is the same, it would be interesting to know what the cause is. You could activate httpyac.logLevel=debug in vscode and look for a reason for the timeout in Output. Perhaps you could also put together an example with which the behavior can be reproduced (preferably directly with Postman Echo).