.http file to cURL & code converter
Paste a .http or .rest file in the REST Client / JetBrains format. Every request becomes a snippet for cURL, JavaScript fetch, Node.js, Python requests, Go, HTTPie, PowerShell, wget, C#, PHP or Java. File variables (@host = …) are resolved, and you can add environment values below. GraphQL requests are sent as JSON and Basic auth is encoded, exactly as when the request is sent.
Runs in this page with the same code as Plainwire’s Copy as Code command. Nothing you paste is uploaded or stored.
What is resolved
- File variables (
@baseUrl = https://…) and the values you enter under Variables, including$sharedvalues in anhttp-client.env.json. - System variables:
{{$guid}},{{$timestamp}},{{$randomInt 1 100}},{{$datetime iso8601}}. - Unknown variables and chained values such as
{{login.response.body.$.token}}are left as written and listed above the snippets, so you can see what still needs a value. - Bodies: form bodies split over
&lines are joined, multipart bodies get CRLF line endings, GraphQL becomes{"query", "variables"}JSON, and a< ./filebody becomes code that reads the file.
Do it inside VS Code
With Plainwire installed, every request in a .http file gets a Copy as Code… link above it, using your selected environment and values from earlier responses. To go from cURL to a .http file instead, use the cURL, Postman and Thunder Client to .http converter.
More: cURL flags and their .http equivalents, .http file syntax reference, GraphQL in .http files.