Posted: Thu Dec 28, 2023 2:44 pm Post subject: Reset API Not Returning any response
Newbie
Joined: 18 Dec 2023 Posts: 3
I am trying to connect to a rest API through HTTP Request Node to get OAuth token, But the flow isn't erroring or no progress once it reaches Http Request node. Is there any special setting to be done or how do I trace the activity of the http request node?
Http Input --> Compute --> Http Request --> Http Reply
SET OutputLocalEnvironment.Destination.HTTP.RequestURL = OAuthURL;
SET OutputLocalEnvironment.Destination.HTTP.RequestLine.Method = 'POST';
SET OutputRoot.BLOB.BLOB = CAST('client_id=' || client_id || '&grant_type=' || grant_type || '&scope=' || scope || '&client_secret=' || client_secret AS BLOB CCSID 1208);
Set OutputRoot.HTTPRequestHeader."Content-Type" = 'application/x-www-form-urlencoded';
I'm not sure if this is your only problem but what you posted shows that the order of message creation is wrong. The message is built and sent in the order it is created, so you need to create the RequestHeaders before BLOB body.
Currently these lines:
Code:
SET OutputRoot.BLOB.BLOB = CAST('client_id=' || client_id || '&grant_type=' || grant_type || '&scope=' || scope || '&client_secret=' || client_secret AS BLOB CCSID 1208);
Set OutputRoot.HTTPRequestHeader."Content-Type" = 'application/x-www-form-urlencoded';
Should be:
Code:
Set OutputRoot.HTTPRequestHeader."Content-Type" = 'application/x-www-form-urlencoded';
SET OutputRoot.BLOB.BLOB = CAST('client_id=' || client_id || '&grant_type=' || grant_type || '&scope=' || scope || '&client_secret=' || client_secret AS BLOB CCSID 1208);
Also check that your compute node that is building your OutputLocalEnvironment has the ComputeMode property set to one of the modes that includes the LocalEnvrionment such as "ALL"
I hope that helps get you going... _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum