cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-598300%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%E5%A6%82%E4%BD%95%E8%AE%80%E5%8F%96%20HTTP%20%E9%9F%BF%E6%87%89%E6%A8%99%E9%A0%AD%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-598300%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E8%AC%9D%E8%AC%9D%EF%BC%81%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-493094%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%E5%A6%82%E4%BD%95%E8%AE%80%E5%8F%96%20HTTP%20%E9%9F%BF%E6%87%89%E6%A8%99%E9%A0%AD%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-493094%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Modified%20from%20%26lt%3B%26lt%3BGetResponseHeaders%20in%20Scripting%20Index%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Modified%20from%20%26lt%3B%26lt%3BGetResponseHeaders%20in%20Scripting%20Index%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Modified%20from%20%26lt%3B%26lt%3BGetResponseHeaders%20in%20Scripting%20Index%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Modified%20from%20%26lt%3B%26lt%3BGetResponseHeaders%20in%20Scripting%20Index%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Modified%20from%20%26lt%3B%26lt%3BGetResponseHeaders%20in%20Scripting%20Index%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F42714iCD700B99B28557D4%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture.PNG%22%20alt%3D%22Modified%20from%20%26lt%3B%26lt%3BGetResponseHeaders%20in%20Scripting%20Index%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EModified%20from%20%26lt%3B%26lt%3BGetResponseHeaders%20in%20Scripting%20Index%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EModified%20from%20%26lt%3B%26lt%3BGetResponseHeaders%20in%20Scripting%20Index%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EModified%20from%20%26lt%3B%26lt%3BGetResponseHeaders%20in%20Scripting%20Index%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EModified%20from%20%26lt%3B%26lt%3BGetResponseHeaders%20in%20Scripting%20Index%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E%E4%BF%AE%E6%94%B9%E8%87%AA%E8%85%B3%E6%9C%AC%E7%B4%A2%E5%BC%95%E4%B8%AD%E7%9A%84%20%26lt%3B%3CGETRESPONSEHEADERS%3E%3C%2FGETRESPONSEHEADERS%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E7%B7%A8%E8%BC%AF%EF%BC%9A%E9%80%99%E6%B2%92%E6%9C%89%E6%88%91%E6%83%B3%E8%A6%81%E7%9A%84%E9%82%A3%E9%BA%BC%E6%B8%85%E6%A5%9A%EF%BC%8C%E5%9B%A0%E7%82%BA%3CEM%3E%26lt%3B%26lt%3B%E7%99%BC%E9%80%81%3C%2FEM%3E%E6%98%AF%E6%AD%A3%E5%9C%A8%E8%99%95%E7%90%86%E7%9A%84%E6%B6%88%E6%81%AF%E5%90%8D%E7%A8%B1%3CEM%3E%E7%99%BC%E9%80%81%3C%2FEM%3E%E5%88%B0%E5%90%8D%E7%82%BA%E8%AE%8A%E9%87%8F%E7%9A%84%E5%B0%8D%E8%B1%A1%3CEM%3E%E8%A6%81%E6%B1%82%3C%2FEM%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-493044%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%A6%82%E4%BD%95%E8%AE%80%E5%8F%96%20HTTP%20%E9%9F%BF%E6%87%89%E6%A8%99%E9%A0%AD%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-493044%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%81%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E5%98%97%E8%A9%A6%E4%BD%BF%E7%94%A8%20JSL%20(JMP%2016.2.0)%20%E5%BE%9E%20API%20%E8%AE%80%E5%8F%96%E6%95%B8%E6%93%9A%EF%BC%8C%E8%A9%B2%20API%20%E5%9C%A8%E9%9F%BF%E6%87%89%E6%A8%99%E9%A0%AD%E4%B8%AD%E5%8C%85%E5%90%AB%E4%B8%80%E4%BA%9B%E7%9B%B8%E9%97%9C%E6%95%B8%E6%93%9A%EF%BC%88%E7%89%B9%E5%88%A5%E6%98%AF%EF%BC%8C%E6%88%91%E6%83%B3%E6%AA%A2%E6%9F%A5%20Content-Location%20%E6%A8%99%E9%A0%AD%E4%BB%A5%E7%99%BC%E5%87%BA%E5%BE%8C%E7%BA%8C%E8%AB%8B%E6%B1%82%EF%BC%89%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%88%91%E8%83%BD%E6%89%BE%E5%88%B0%E7%9A%84%E9%97%9C%E6%96%BC%E7%99%BC%E5%87%BA%20HTTP%20%E8%AB%8B%E6%B1%82%E7%9A%84%E5%94%AF%E4%B8%80%E6%96%87%E6%AA%94%E6%98%AF%E7%A4%BA%E4%BE%8B%E3%80%82%20%E5%9C%A8%E9%80%99%E4%BA%9B%E7%A4%BA%E4%BE%8B%E4%B8%AD%EF%BC%8C%E9%80%9A%E5%B8%B8%E6%9C%89%E5%A6%82%E4%B8%8B%E8%AA%BF%E7%94%A8%EF%BC%9A%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Erequest%20%3D%20New%20HTTP%20Request(%0A%20URL(%20url%20)%2C%0A%20Method(%20%22GET%22%20)%2C%0A%20Headers(%7B%20%22Authorization%3A%20Basic%20%22%20%7C%7C%20credentials%20%7D)%0A)%3B%0Adata%20%3D%20request%20%26lt%3B%26lt%3B%20Send()%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%20class%3D%22%22%3E%E7%95%B6%E6%88%91%E9%80%99%E6%A8%A3%E5%81%9A%E6%99%82%EF%BC%8C%E6%95%B8%E6%93%9A%E5%8C%85%E5%90%AB%20HTTP%20%E9%9F%BF%E6%87%89%E6%AD%A3%E6%96%87%E7%9A%84%E5%85%A7%E5%AE%B9%EF%BC%8C%E6%9C%89%E6%95%88%E5%9C%B0%E5%89%9D%E9%9B%A2%E4%BA%86%E6%88%91%E9%9C%80%E8%A6%81%E7%9A%84%E9%9F%BF%E6%87%89%E6%A8%99%E9%A0%AD%E3%80%82%3C%2FP%3E%3CP%20class%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22%22%3E%E6%9C%89%E4%BB%80%E9%BA%BC%E6%96%B9%E6%B3%95%E5%8F%AF%E4%BB%A5%E7%99%BC%E9%80%81%20HTTP%20%E8%AB%8B%E6%B1%82%EF%BC%8C%E4%BB%A5%E4%BE%BF%E6%88%91%E5%8F%AF%E4%BB%A5%E6%AA%A2%E6%9F%A5%20JSL%20%E4%B8%AD%E7%9A%84%E9%9F%BF%E6%87%89%E6%A8%99%E9%A0%AD%EF%BC%9F%20%EF%BC%88%E6%9C%80%E6%9C%89%E5%B9%AB%E5%8A%A9%E7%9A%84%E6%98%AF%EF%BC%8C%E6%98%AF%E5%90%A6%E6%9C%89%E4%BB%BB%E4%BD%95%E6%96%87%E6%AA%94%E5%8F%AF%E4%BB%A5%E5%AE%8C%E6%95%B4%E8%A7%A3%E9%87%8B%20HTTP%20%E8%AB%8B%E6%B1%82%20API%EF%BC%9F%EF%BC%89%3C%2FP%3E%3CP%20class%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22%22%3E%E6%84%9F%E8%AC%9D%E6%82%A8%E7%9A%84%E5%B9%AB%E5%8A%A9%EF%BC%81%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-493044%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3E%E5%85%A7%E5%AE%B9%E7%B5%84%E7%B9%94%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
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!

Recommended Articles