ansibleguy76/ansibleforms

Using application/x-www-form-urlencoded in headers and body of RestAdvanced doesnt work

Closed this issue · 2 comments

Describe the bug
Using application/x-www-form-urlencoded in headers and body doesn't encode in URL format the body or headers

To Reproduce

expression: fn.fnRestAdvanced(
'post',
$(test.host)/login',
'username=$(test.user)&password=$(test.password)&client_id=$(test.user)&client_secret=$(test.password)',
{'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'},
'.access_token',
'')

Expected behavior
URL encode the user that has domain\username
URL encode the password that has symbols %^'/*!&#\ etc...

Screenshots
N/A

Version
ansibleforms v5.0.1

Deployment
Deployed ansibleforms with :

  • nodejs native

Additional context
Add any other context about the problem here.

hi

if you want to have the headers encoded in a specific way, you should encode them yourself. make a hidden intermediate expression and encode as you wish (runLocal true will allow the full javascript engine) and then use the outcome of that intermediate field in your custom headers.

Oki but I think that as long as you specify this header (application/x-www-form-urlencoded) it shall be done automatically...