http.client.request post() issue
Hi,
I'm trying to connect to graphql and trying to do the authorization first. However, I keep on getting error like "html found in response" and if I try to get the content of such a response, getting "302 found".
This is what I'm using:
<#assign response = http.client.request(protocol, host, url).body("{ 'grant_type':'refresh_token', 'refresh_token':'${upAuth.refreshToken}', 'client_id':'${upAuth.clientId}', 'client_secret':'${upAuth.clientSecret}' }", "application/x-www-form-urlencoded").post()>
refresh_token is value from the cookie -- oauth2v2_bunch_of_characters_here that was set up by a javascript function.
Tried adding parameters, headers, change body content type to application/json, basically anything that I can come up with, but none seem to work.
Domain is whitelisted as well.
I'm able to do everything with jquery and ajax, just not with the http.client.request with the same parameters. Would opt out doing it that way, but need to protect client id and client secret values.
What am I doing wrong here? Any help is appreciated.