thunderclient / thunder-client-support

Thunder Client is a lightweight Rest API Client Extension for VS Code.
https://www.thunderclient.com
Other
3.64k stars 132 forks source link

Import curl doesn't work well #1557

Open noam-honig opened 5 months ago

noam-honig commented 5 months ago

Describe the bug Love this tool.

I use import curl a lot - and it misbehaves, consider the following curl:

curl 'http://localhost:3000/' \
  -H 'Accept: text/x-component' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: text/plain;charset=UTF-8' \
  -H 'Cookie: next-auth.csrf-token=6e6d1031692e7d21620ef917224953d5460d589aac1eb0304ce66d59585b9b86%7Cab4d2b3c386b4b1d4377d8411a85fbad1ed12417ffe70f199699393efc120dbb; next-auth.callback-url=http%3A%2F%2Flocalhost%3A3000%2F; next-auth.session-token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..TPMVxKsM2PJurq_w.-8XWj2084mthXAqR9p7GKGo61fWuxNTpJGKVq1EUYJXDQ_nT9EyhkMZU3NCv2VjDvPvCGAiw9GLl2NoKAumN3dvjnmTLoIgCqELdsMb_e6JEB0tdEVkTG2K12MOPXA0iUCDshZE2k3uVhXw.TeEL1hVpExaN1QS_dmx3TA' \
  -H 'Next-Action: 03702d592dabc244293460974fbc8a99a09f71e8' \
  -H 'Next-Router-State-Tree: %5B%22%22%2C%7B%22children%22%3A%5B%22__PAGE__%22%2C%7B%7D%2C%22%2F%22%2C%22refresh%22%5D%7D%2Cnull%2Cnull%2Ctrue%5D' \
  -H 'Origin: http://localhost:3000' \
  -H 'Referer: http://localhost:3000/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  --data-raw '[{"title":"123"}]'
  1. First time I import it I get an error "Failed to import cUrl"
  2. Second time I import it it imports but when I run it I get "Invalid IP address: undefined"
  3. When I change "localhost" to 127.0.0.1 it calls (but then my server - nextjs doesn't like the url change :))

Platform:

Are you using the free version/paid version/trial: Free version

noam-honig commented 2 months ago

@rangav any updates on this?

rangav commented 2 months ago

@noam-honig I imported the above cURL its working for me.

Not executing the request is a different issue.

noam-honig commented 2 months ago

Hi @rangav thanks for getting back to me - I've tested this on a few windows 10 /11 machines. In all - the first time I request to import this curl it fails - it only imports it the second time. Also - in all I need to change the address from localhost to [::1] to get it to work

noam-honig commented 2 weeks ago

Unfortunately the import from curl is not available any more for this tool - that's kinda of my queue to stop using it.

A bit sad, but I guess you have your reasons