cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
BenchlingVic
Level I

How do I read HTTP response headers?

Hello!

 

I am trying to use JSL (JMP 16.2.0) to read data from an API which contains some relevant data in response headers (in particular, I want to examine the Content-Location header to make a subsequent request).

 

The only documentation I can find around making HTTP requests are examples. In these examples, there is generally a call along the lines of:

request = New HTTP Request(
	URL( url ),
	Method( "GET" ),
	Headers({ "Authorization: Basic " || credentials })
);
data = request << Send();

When I do this, data contains the contents of the HTTP response body, effectively stripping out the response headers I need.

 

Is there any way to send an HTTP request such that I can examine response headers in JSL? (Most helpfully, is there any documentation which explains the HTTP request API fully?)

 

Thanks for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: How do I read HTTP response headers?

Modified from <<GetResponseHeaders in Scripting IndexModified from <<GetResponseHeaders in Scripting Index

Edit: That's less clear than I wanted it to be because <<Send is the message name that is being sent to the object in the variable named request.

Craige

View solution in original post

2 REPLIES 2
Craige_Hales
Super User

Re: How do I read HTTP response headers?

Modified from <<GetResponseHeaders in Scripting IndexModified from <<GetResponseHeaders in Scripting Index

Edit: That's less clear than I wanted it to be because <<Send is the message name that is being sent to the object in the variable named request.

Craige
UersK
Level III

Re: How do I read HTTP response headers?

Thanks!