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

Post cURL is recognized as a get request #790

Closed
iafine opened this issue Mar 12, 2021 · 5 comments
Closed

Post cURL is recognized as a get request #790

iafine opened this issue Mar 12, 2021 · 5 comments
Labels

Comments

@iafine
Copy link

iafine commented Mar 12, 2021

  • REST Client Version: 0.24.4
  • VSCode Version: 1.53.0
  • OS Version: MacOS Big Sur [version 11.1 (20C69)]

Steps to Reproduce:

  1. Copy a post request as cURL from chrome network tab.
  2. Run it into a http file, and click send request button.
  3. It is recognized as a get request.

cURL Demo:

curl 'http://localhost:8010/api/v2/job/5fb72b61ea65af000a5d8fa7/transform_to_refresh' \
  -H 'Connection: keep-alive' \
  -H 'sec-ch-ua: "Chromium";v="88", "Google Chrome";v="88", ";Not A Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNWVmZDkxODllYzc2MzQwMDAxZjAzNjVjIiwibW9iaWxlIjoiMTc2MDc1NTcxMzMiLCJlbWFpbCI6bnVsbCwiYWNjZXNzIjp7InJvbGVzIjpbeyJuYW1lIjoiXHU0ZjAxXHU0ZTFhXHU3YmExXHU3NDA2XHU1NDU4IiwiaWQiOiI1ZTFkNjkyZTBkMzhjN2M2ZGViN2Y3YTQiLCJrIjoiYWRtaW4iLCJwIjoiYnRwIn1dLCJncm91cHMiOlsiNWRmODNlOTQzM2MxYTIxMTg4MDUyODIwIiwiNWUwMzY3NGM5OTI2MDlhODkzMWJkZTllIl0sInBlcm1pc3Npb24iOlsidmlld19yZXN1bWVfb3duZXJfY2hhbmdlIiwidmlld19jb21wYW55X21lbWJlcnMiLCJ2aWV3X21lbnVfdG9wIiwidmlld19tZW51X3NpZGViYXIiLCJ2aWV3X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ZXRhaWwiLCJyZXN1bWVfc3RhdGlzdGljcyIsInZpZXdfZXh0X2Rvd25sb2FkIiwidmlld19yZXN1bWVfam9pbl9mb2xkZXIiLCJ2aWV3X3VwbG9hZF9yZXN1bWVfcGFnZSIsInZpZXdfam9iIiwidmlld19yZXN1bWVfY2FuZGlkYXRlX3N0YXR1cyIsInZpZXdfcmVzdW1lX2V4cG9ydCIsInZpZXdfcmVzdW1lX2RlbGV0ZSIsInZpZXdfcmVzdW1lX3VwbG9hZF9ub3JtYWwiXSwiZyI6W3siayI6ImRlZmF1bHRfaGVhZGh1bnRlciIsInAiOiJidHAifSx7ImsiOiJkZWZhdWx0X29wZW5hcGkiLCJwIjoib3BlbmFwaSJ9XX0sInVzZXJfdHlwZSI6MSwiZXhwIjoxNjE2MTIyMjIzfQ.kzPiCOG78LGCjaR1oYVWJkFBlv10RvANsQ4f-hm_GdQ' \
  -H 'x-channel: xclient' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36' \
  -H 'Cache-Control: no-cache' \
  -H 'Origin: chrome-extension://fboahkpeeonmlaonblpdjhcdjcegokbk' \
  -H 'Sec-Fetch-Site: none' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8' \
  --data-raw '{"channel":"zhilian"}' \
  --compressed

In Postman and shell , It is recognized as a post request, vscode-restclient is a get request, look like is --data-raw problem?

@Huachao
Copy link
Owner

Huachao commented Mar 29, 2021

@iafine nice catch, this will be published in the next releasee

@Huachao Huachao closed this as completed Mar 29, 2021
@Huachao Huachao added the bug label Mar 29, 2021
@Huachao
Copy link
Owner

Huachao commented Apr 6, 2021

@iafine this has been fixed in the latest version 0.24.5 and you can verify it

@iafine
Copy link
Author

iafine commented Apr 7, 2021

@iafine this has been fixed in the latest version 0.24.5 and you can verify it

Unfortunately, it doesn’t seem to work in 0.24.5, but thank you anyway.

You can find a post request on chrome and copy it as curl to an http file. In most cases, it will be recognized as get request.

image

@Huachao
Copy link
Owner

Huachao commented Apr 7, 2021

@iafine I can work with following request code snippet

curl 'https://api.qlrc.com/Other/UserPageStatistics' \
  -H 'Connection: keep-alive' \
  -H 'sec-ch-ua: "Chromium";v="88", "Google Chrome";v="88", ";Not A Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'x-channel: xclient' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36' \
  -H 'Cache-Control: no-cache' \
  -H 'Origin: chrome-extension://fboahkpeeonmlaonblpdjhcdjcegokbk' \
  -H 'Sec-Fetch-Site: none' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8' \
  --data-raw '{"pageTypeId":6070403}' \
  --compressed

Could you please confirm again that you've already upgrade to the latest version?

@iafine
Copy link
Author

iafine commented Apr 8, 2021

I restarted vscode today and found that it works, thank you very much, very useful extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants