HTTP_CUSTOM_HEADERS

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
colin.rogers
Newbie
Posts: 11
Joined: Sat Oct 28, 2017 11:49 am

HTTP_CUSTOM_HEADERS

Post by colin.rogers » Wed Apr 10, 2019 12:35 am

Hi team,

We are creating some code to handle routine MS Azure functions. First we collect the bearer token, which seems to work. Then when we use the token, we have some difficulties.

We are following the guidance for HTTP_CUSTOM_HEADERS, as follows.

Let>HTTP_CUSTOM_HEADERS=Authorization: Bearer %strtoken%%CRLF%Accept: application/json

We receive an Unauthorized 401 response using HTTPRequest. So we inspect the GET and it doesn't look right because there is no sign of custom headers or the token, as shown here.

Headers
connection close
x-forwarded-for 86.166.151.203
user-agent Macro Scheduler (www.mjtnet.com)
accept-encoding identity
accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
host webhook.site
content-type application/x-www-form-urlencoded
content-length (empty)

A similar GET from Postman does show the header and token, which seem to be missing above, and the 401 disappears.

Headers
connection close
x-forwarded-for 86.166.151.203
accept-encoding gzip, deflate
host webhook.site
accept */*
user-agent PostmanRuntime/7.6.1
authorization Bearer eyJ0eXAiOiJKV...
postman-token 364...
cache-control no-cache

Any suggestions are very welcome.

colin.rogers
Newbie
Posts: 11
Joined: Sat Oct 28, 2017 11:49 am

Re: HTTP_CUSTOM_HEADERS

Post by colin.rogers » Wed Apr 10, 2019 11:49 am

Hi team,

We found the solution here and wanted to share.
The HTTP_CUSTOM_HEADERS is a recent feature and we hadn't upgraded.
We have now upgraded to V14.5.4 (January 2019) and the HTTP_CUSTOM_HEADERS are now handled.
Without the new version, they are understandably treated as normal variables, not special ones.

That is the second time we have been caught out by failing to upgrade - there won't be a third !

Thanks.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1389
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: HTTP_CUSTOM_HEADERS

Post by Dorian (MJT support) » Thu Apr 11, 2019 8:15 am

Hi Colin,

It's great to hear your issue was resolved.
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts