Huachao / vscode-restclient

REST Client Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
MIT License
5.29k stars 440 forks source link

Command 'Rest Client: Copy Request As cURL' resulted in an error (validation failed) #1093

Open sohang3112 opened 1 year ago

sohang3112 commented 1 year ago

Steps to Reproduce:

  1. Create an HTTP file with a request having non-reachable url. For example:
    
    @base_url = 192.168.67.48:8764

POST {{base_url}}/main_image Content-Type: application/json

{ "s3_image_url": "s3://ecomm-recommendation/ecomm_recommendation_scrapped/test_img.png", "platform": "amazon" }


2. Put cursor in request and run VS Code command `Rest Client: Copy Request as cURL`
3. The following error message appears:

![image](https://user-images.githubusercontent.com/31966963/202380531-c46decde-4c89-4bd1-8d5a-f8b447171c50.png)

**Note:** This used to work a few days ago - but now it gives this error message. No idea what changed - maybe the extension was updated.
sohang3112 commented 1 year ago

BTW I'm not sure what validation is done - maybe it's whether the url is reachable or not. Whatever it is, there should be a setting to skip the validation.

sohang3112 commented 3 months ago

@Huachao Is anyone working on this issue? If not, I would like to work on it - would you be interested in a PR to fix this issue?