- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2017 06:48 AM
Hi,
I have created a scripted REST API where I am fetching the HTTP headers by using the below function
request.getHeader('header name').
But I want to fetch all the headers that we receive in the request. I tried to use request.headers as suggested in docs but it gives me [object Object]
Any suggestions?
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2017 08:52 AM
Please try this, You should convert the Json to string
var header = request.headers;
var json = new JSON();
var headerStr = json.encode(header);
gs.log(headerStr);
Thanks
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 05:28 AM
Thank You
Thanks
PS: Hit like, Helpful or Correct depending on the impact of the response