HTTP Request Builder
Describe a request once — get curl, Java HttpClient, RestTemplate, WebClient, RestClient and fetch. Nothing is sent anywhere.
In-browser & private
Query parameters
Headers
Fill in a URL to see the code.
Method GET
Headers 0
Params 0
Body 0 B
About this builder
It generates code rather than firing the request. That is a deliberate limit, not a missing feature: a browser cannot call an arbitrary API from a page like this — the target would have to return CORS headers naming this site — so a "send" button would fail on most real endpoints and succeed on a misleading few.
- Six targets from one description: curl, Java 11+
HttpClient, SpringRestTemplate, reactiveWebClient, Spring 6RestClient, and browserfetch. - Import curl reads a command you copied from your browser's network tab (Copy as cURL) and fills the form, which is the quickest way to turn something that works in a browser into Java.
- Quoting is handled. Bodies and header values are escaped for each language, so a
JSON body containing quotes, backslashes or a regex like
\d+still compiles and still carries exactly the bytes you typed. - The Java comes with its imports. Each snippet lists what it needs, so it pastes
into a file and compiles rather than sending you looking for which
HttpHeaderswas meant. - Nothing is stored or transmitted. Tokens you paste stay in the page — but remember the generated code contains them, so redact before sharing it.
Frequently asked questions
- Can I send the request from here?
- No, and that is deliberate. A page in your browser cannot call an arbitrary API unless that API returns CORS headers naming this site, so a send button would fail on most real endpoints and work on a misleading few. The generated code has no such limit, because it does not run in a browser.
- Which Java HTTP client should I use?
- On plain Java 11 or newer,
HttpClientneeds no dependency at all. In Spring 6.1 or Boot 3.2 and later,RestClientis the one to reach for: it is synchronous likeRestTemplatebut with a fluent API. KeepWebClientfor genuinely reactive code, where you return theMonorather than blocking on it. - Is
RestTemplatedeprecated? - Not deprecated, but in maintenance mode. It still works and is still everywhere, and
Spring steers new code towards
RestClient. There is no urgency to rewrite what already runs. - What does Import curl handle?
- The output of Copy as cURL from Chrome, Firefox and Edge, on Unix or Windows,
including backslash continuations and both quoting styles. Headers, the method, query parameters and the
body all come across. Basic auth from
-ubecomes an Authorization header, and cookies from-bbecome a Cookie header, so they survive into every generated client. - Why does my JSON body appear as a Java text block?
- Because a twenty-line body escaped onto a single line is unreadable, and unreadable generated code gets rewritten by hand. A text block keeps the JSON looking like JSON. Backslashes and quote runs inside it are still escaped, since a text block is a string literal like any other, and a body containing a carriage return falls back to a normal literal because a text block cannot hold one.
- Is my token safe to paste here?
- Nothing you type leaves the page: there is no request and no storage. Do remember that the generated code contains the token verbatim, so redact it before pasting that code into a ticket, a commit or a chat.