Skip to content

Instantly share code, notes, and snippets.

@JamesBoon
Last active August 13, 2023 11:51
Show Gist options
  • Save JamesBoon/888c3ea08cdaac141d6e2e12b1978784 to your computer and use it in GitHub Desktop.
Save JamesBoon/888c3ea08cdaac141d6e2e12b1978784 to your computer and use it in GitHub Desktop.
IntelliJ IDEA HTTP Client x-www-form-urlencoded
### Send POST request with body as parameters
< {%
const props = {
email: '[email protected]',
firstname: 'Test',
lastname: 'User',
company: 'Example & Co',
};
const body = Object.keys(props).map(function(key) {
return encodeURIComponent(key) + '=' + encodeURIComponent('' + props[key]);
}).join('&');
request.variables.set("body", body);
%}
POST https://httpbin.org/post
Content-Type: application/x-www-form-urlencoded
{{body}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment