Jump to content

Recommended Posts

Posted

Hello,
We want to use ASYRRESTCLI.EXEC_REST_WS to connect to an API but we are having problems with the header
In an example from the help that we have used on multiple occasions it would be like this:

HCOD(1)="Content-Type"


HVAL(1)= '"application/json"'

This API requires the header to be like this: 'Authorization: OAuth oauth_consumer_key="key",oauth_token="token"'

So we set the variables as follows:

  HCOD(1)='Authorization'


  HVAL(1)= '”OAuth oauth_consumer_key="key",oauth_token="token"”’

This returns the following error:

image.png.36ea1a5e1f3989f44b181cf634fc2694.png

 

The problem is the quotes around HVAL. How can we put the quotes around “key” so that it doesn't give an error? We have tried many combinations but always with the same result.


The only way to avoid an error is to put it like this:
'"OAuth oauth_consumer_key=key,oauth_token=token"'


But this way, it returns statuscode=500

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...