Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
MarcinW
- Junior Coder
- Posts: 24
- Joined: Thu Jul 23, 2020 11:24 pm
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?
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
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.
-
MarcinW
- Junior Coder
- Posts: 24
- Joined: Thu Jul 23, 2020 11:24 pm
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.
