Page 1 of 1

Read HTTP request headers

Posted: Thu Apr 30, 2015 3:14 pm
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"

Re: Read HTTP request headers

Posted: Thu Apr 30, 2015 4:11 pm
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');

Re: Read HTTP request headers

Posted: Tue May 05, 2015 2:06 pm
by Musa
That works, thanks.