Forum Discussion
encodeURIComponent(“password”) is just password (there’s nothing that needs to be encoded), so you could simplify that to just "grant_type=password&username=" + ...
But I still don’t understand how you’re able to get account.username and account.password to resolve.
Upload body type isn’t used here. But you do need to add a row to the “HTTP header” table with Content-Type application/x-www-form-urlencoded, as I showed in the screenshot from my last reply.
Ah! I just looked at that other Community post you linked. I wasn’t aware of that hack. But I’m pretty sure it only works in an expression used in the Value column of the HTTP Headers table, not anywhere else. I don’t think you’ll be able to use it for the request body.
- jsmith1414 years agoNew Contributor III
Oh I apologize for the confusion, I already had that specific header in place We are successfully using the account.username and account.password in another pipeline i.e. in the HTTP entity field of the POST snap.
- ptaylor4 years agoEmployee
Wow! You’re right. I guess I hadn’t tried it with exactly the right syntax. This expression works just fine in the HTTP Entity field:
"grant_type=password&username=" + account.username +"&password=" + encodeURIComponent(account.password)- jsmith1414 years agoNew Contributor III
Oh yeah the statement itself validates, but I am still getting a 400 bad request error