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

[feature] import curl #238

Closed maicss closed 8 months ago

maicss commented 8 months ago

Excellent work, thanks!

Would you like to add a function: import curl command?

myfonj commented 8 months ago

I'd also highly appreciate the other way round (export): copy request as curl command I.e. all effective request data (including those from resolved refs) and serialized them all one compact chunk of curl -X .. -H .. -H .. -d .... that one could immediately try in terminal or share with folks that have not httpYac available.

AnWeber commented 8 months ago

@myfonj Export Feature is already supported. You can use command httpyac.generateCodeSelectLanguage (default output curl ito clipboard) or httpyac.generateCode to select generated language.

I don't quite see the use case for import. curl can actually already be run anyway and the added value with import is low. I actually want/need to write an OpenAPI import sometime soon, so this feature may fall out as a byproduct, But I had already discussed it away once. Gladly but PR integrable. I can also help. Alternatively, I would refer to this page.: https://reqbin.com/req/c-w7oitglz/convert-curl-to-http-request