Code Generation
Vegha can turn any request into ready-to-run client code. This is useful for handing an API call to a colleague, dropping it into an application, or documenting how an endpoint is called.
Opening the code-generation panel
Section titled “Opening the code-generation panel”With a request open, open the code-generation panel. It shows the request expressed as client code, with a selector for the target language or HTTP client.
Targets
Section titled “Targets”Vegha generates code for six targets:
| Target | Language / library |
|---|---|
| curl | Shell command |
Node.js fetch | JavaScript |
Python requests | Python |
Go net/http | Go |
C# HttpClient | C# |
| Java OkHttp | Java |
Select a target and the panel updates to show the equivalent snippet.
What the generated code reflects
Section titled “What the generated code reflects”The snippet mirrors the request as configured:
- The URL, including query parameters
- The HTTP method
- All headers
- The request body
- The request’s auth, where it can be expressed in that target
Copying the snippet
Section titled “Copying the snippet”Copy the generated code from the panel and paste it wherever you need it — a terminal, a script, or an application.