Read HTTP request headers

Use this board for starting discussions, asking questions, and giving advice on Web programming for the IBM i platform (and predecessors.)
Musa
New User
Posts: 2
Joined: Wed Sep 03, 2014 9:39 am
First Name: Musa
Last Name: Mitchell
Company Name: Guardian General Insurance
State / Province: Outside Canada/USA
Country: Trinidad and Tobago
Contact:

Read HTTP request headers

Post by Musa »

I'd like to serve 206 partial requests, from a rpgsp program. Is there a way to read the Range header to get the bytes range of the content to serve?
GET /path/to/program?which=84 HTTP/1.1
Host: domain.tld
Connection: keep-alive
Accept: */*
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-TT,en;q=0.8
Range: bytes=4445184-4446207
If-Range: "423c76-13c625b-514e00a6256c0"
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Read HTTP request headers

Post by Scott Klement »

It should be in the HTTP_RANGE environment variable. So, in RPGsp you can just do something like:

Code: Select all

myvar = RPGspIn('HTTP_RANGE': 'Env');
Musa
New User
Posts: 2
Joined: Wed Sep 03, 2014 9:39 am
First Name: Musa
Last Name: Mitchell
Company Name: Guardian General Insurance
State / Province: Outside Canada/USA
Country: Trinidad and Tobago
Contact:

Re: Read HTTP request headers

Post by Musa »

That works, thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests