Last active
August 13, 2023 11:51
-
-
Save JamesBoon/888c3ea08cdaac141d6e2e12b1978784 to your computer and use it in GitHub Desktop.
IntelliJ IDEA HTTP Client x-www-form-urlencoded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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