[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: http_getContent*
Did you debug getcontenttype and lower (header_find, etc)?
Let us know what you find in those procedures is or is not working as expected.
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Saman Neinawaie
Sent: Wednesday, December 30, 2015 4:29 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: http_getContent*
Hi
I have encountered a problem with procedures http_getContent*.
Could you please have a look at my code?
Thanks,
Sam
*****************************************************
* Prototypes *
*****************************************************
/define HTTP_WSDL2RPG_STUFF
D/Copy LIBHTTP/QRPGLESRC,HTTPAPI_H
D/Copy LIBHTTP/QRPGLESRC,HEADER_H
D/copy LIBHTTP/QRPGLESRC,IFSIO_H
*****************************************************
* Variables & Data Structures *
*****************************************************
D h_RC s like(http_url_get_raw)
D h_URL S 300A varying
D h_Div S like(http_getContentType)
/Free
http_debug(*ON:'/tmp/mydebuglog.txt');
h_URL = 'http://notesserver.com/test1.nsf' +
'/api/data/collections/name/RESTBNUM' +
'?search=FIELD%20DATE%20=%202015-12-28&' +
'start=0&count=100&systemcolumns=0' +
'&compact=TRUE';
h_rc = http_url_get_raw(h_Url:h_FD:%paddr(wrtOut));
h_Div = http_getContentTypeAttr('Content-Length');
//Problem1: h_Div = ''
h_Div = http_getContentSubType();
//Problem2: h_Div = 'jso'
h_Div = http_getContentType();
//Okay: h_Div = 'application'
*InLR = *On;
/End-Free
mydebuglog.txt:
HTTPAPI Ver 1.29 released 2015-02-23
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R1M0
New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819.
ProtLoc=0
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry : 2
DNS resolver options: x'000001B6'
DNS default domain: top.secret.com.gov.info.okay.enough.stop
DNS server found: 172.20.100.4
DNS server found: 172.20.100.5
DNS server found: 194.158.133.1
Nagle's algorithm (TCP_NODELAY) disabled.
http_persist_get(): entered
http_persist_req(GET) entered.
http_long_ParseURL(): entered
http_long_ParseURL(): entered
do_oper(GET): entered
There are 0 cookies in the cache
GET
/test1.nsf/api/data/collections/name/RESTBNUM?search=FIELD%20DATE%20=%202015-12-28&start=0&count=100&systemcolumns=0&compact=TRUE
HTTP/1.1
Host: top.secret.com.gov.info.okay.enough.stop
User-Agent: http-api/1.29
recvresp(): entered
HTTP/1.1 200 OK
Server: Lotus-Domino
Date: Wed, 30 Dec 2015 08:55:31 GMT
Set-Cookie: SessionID=EC78C0139B0662360F4F2059E9C2B277EE036365;
path=/; HttpOnly
Content-Type: application/json
Content-Length: 2
SetError() #13: HTTP/1.1 200 OK
recvresp(): end with 200
recvdoc parms: identity 2
header_load_cookies() entered
cookie_parse() entered
cookie = SessionID=EC78C0139B0662360F4F2059E9C2B277EE036365;
path=/; HttpOnly
cookie attr SessionID=EC78C0139B0662360F4F2059E9C2B277EE036365
cookie attr path=/
cookie attr HttpOnly=
recvdoc(): entered
SetError() #0:
[]
http_close(): entered
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------