Changing headers/content-type in MACRO_RESULT

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
MarcinW
Junior Coder
Posts: 23
Joined: Thu Jul 23, 2020 11:24 pm

Changing headers/content-type in MACRO_RESULT

Post by MarcinW » Mon Oct 05, 2020 1:54 pm

I created a MsNet endpoint to trigger a script. Now in the blog post describing it (https://help.mjtnet.com/article/331-how ... p-requests), MACRO_SCHEDULER variable is used to send response. I am sending json back in the body and would like to change the "Content-Type" to "application/json". I tried this:

Code: Select all

Let>HTTP_POSTJSON=1
Let>HTTP_CUSTOM_HEADERS=Content-Type: application/json
Let>MACRO_RESULT=var_result
This doesn't work, is there actually any way to modify response headers?

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Changing headers/content-type in MACRO_RESULT

Post by Marcus Tettmar » Mon Oct 05, 2020 2:10 pm

I'm afraid there isn't any way to change the content type that msNet returns. I can put this on the wish list, but for now you'll have to assume it is raw text and parse accordingly. Whatever you are using to retrieve the info should be able to convert text into a json object.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

MarcinW
Junior Coder
Posts: 23
Joined: Thu Jul 23, 2020 11:24 pm

Re: Changing headers/content-type in MACRO_RESULT

Post by MarcinW » Mon Oct 05, 2020 2:30 pm

Thanks for the quick response. Yes, we can convert it on the other side, just wondered whether this is possible. :)

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