Error code HTTP

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
OlivierPierre04
Posts: 17
Joined: Fri Jan 07, 2022 2:56 pm

Error code HTTP

Post by OlivierPierre04 »

Hi folks ,
Why the return value http_error does not contain the true http error value such as 200 , 500 ... etc



** Invalid URL format
HTTP_BADURL C CONST(1)
** Host not found (not a valid IP address, or DNS lookup failed)
HTTP_HOSTNF C CONST(2)
** Unable to create a new socket
HTTP_SOCERR C CONST(4)
** Error when connecting to server
HTTP_BADCNN C CONST(6)
** Timeout when connecting to server
HTTP_CNNTIMO C CONST(7)
** HTTP response code logged (not an error, per se)
HTTP_RESP C CONST(13)
** Error calling user-specified procedure in the
** recvdoc() procedure. (user proc must return full count)
HTTP_RDWERR C CONST(16)
** Unsupported transfer-encoding value
HTTP_XFRENC C CONST(20)
** Error opening file to save data into.
HTTP_FDOPEN C CONST(22)
* Problem with the Application ID for the DCM
HTTP_GSKAPPID C CONST(23)
* Error setting auth type
HTTP_GSKATYP C CONST(24)
* Error initializing GSKit environment
HTTP_GSKENVI C CONST(25)
* Error opening GSKit environment
HTTP_GSKENVO C CONST(26)
* Error setting session type (client | server | server_auth)
HTTP_GSKSTYP C CONST(27)
* Error registering application w/DCM
HTTP_REGERR C CONST(28)
* Error open secure socket
HTTP_SSOPEN C CONST(29)
* Error setting SSL numeric file descriptor
HTTP_SSSNFD C CONST(30)
* Error setting SSL numeric timeout value
HTTP_SSSNTO C CONST(31)
** SSL handshake timed out
HTTP_SSTIMO C CONST(32)
** This app is not registered with digital cert mgr
HTTP_NOTREG C CONST(35)
** This URI needs authorization (user/pass)
HTTP_NDAUTH C CONST(36)
** Invalid HTTP authentication type
HTTP_ATHTYP C CONST(37)
** Error in value of an HTTP authentication string
HTTP_ATHVAL C CONST(38)
** Server didn't ask for authorizatin
HTTP_NOAUTH C CONST(39)
** blockread() timed out waiting for more data
HTTP_BRTIME C CONST(43)
** blockread() error during recv() call
HTTP_BRRECV C CONST(44)
** blockread() error during select() call
HTTP_BRSELE C CONST(45)
** recvchunk() did not get the trailing CRLF chars
HTTP_RDCRLF C CONST(46)
* Invalid exit point registered with HTTP_Xproc()
HTTP_BADPNT C CONST(47)
* Error retrieving SSL protocol
HTTP_SSPROT C CONST(48)
* Unknown SSL protocol
HTTP_SSPUNK C CONST(49)
* Error setting SSL protocol
HTTP_SSPSET C CONST(50)
* Out of memory
HTTP_NOMEM C CONST(51)
* Must give data in order to encode it
HTTP_NODATA C CONST(52)
* Pointer is invalid or already freed
HTTP_INVPTR C CONST(53)
* Not enough space to add encoded variable
HTTP_NOSPAC C CONST(54)
* Error calling send() API in BlockWrite()
HTTP_BWSEND C CONST(55)
** Error calling select() API in BlockWrite()
HTTP_BWSELE C CONST(56)
** Timeout waiting to send in BlockWrite()
HTTP_BWTIME C CONST(57)
** Lineread() had problem with recv() API
HTTP_LRRECV C CONST(58)
** Lineread() had problem with select() API
HTTP_LRSELE C CONST(59)
** Lineread() had timeout
HTTP_LRTIME C CONST(60)
** Procedure is no longer supported
HTTP_NOTSUPP C CONST(61)
** No communication driver defined
HTTP_NOCDRIV C CONST(62)
** Timeout sending data in blockwrite
HTTP_BWTIMO C CONST(63)
** Timeout sending data in blockwrite
HTTP_SWCERR C CONST(64)
** Timeout sending data in blockwrite
HTTP_FDSTAT C CONST(65)
* Error parsing XML data
HTTP_XMLERR C CONST(66)
* Error opening IFS file
HTTP_IFOPEN C CONST(67)
* Error with SSL keyring
HTTP_GSKKEYF C CONST(68)
* Must Use Table / Must not Use Table
HTTP_MUTABLE C CONST(69)
* Cookie file cant be written
HTTP_CKDUMP C CONST(70)
* Cookie file cant be read
HTTP_CKOPEN C CONST(71)
* Can't get stats on cookie file
HTTP_CKSTAT C CONST(72)
* Error converting CCSIDs
HTTP_CONVERR C CONST(73)
** Error setting stream file CCSID
HTTP_SETATTR C CONST(74)
** This Proxy server needs authorization (user/pass)
HTTP_PXNDAUTH C CONST(75)
** XML callback switched illegally
HTTP_ILLSWC C CONST(76)
** Error getting certificate info
HTTP_SSLGCI C CONST(77)
** Error from certificate validation callback
HTTP_SSLVAL C CONST(78)
** Error setting TLS versions
HTTP_TLSSET C CONST(79)
** Error with a Reader/Writer
HTTP_BAD_RDWR C CONST(80)
** Invalid HTTP_setAuth password parameter data type
HTTP_ATHPDT C CONST(81)
Scott Klement
Site Admin
Posts: 658
Joined: Sun Jul 04, 2021 5:12 am

Re: Error code HTTP

Post by Scott Klement »

The codes you see in HTTPAPI are HTTPAPI's error codes.

Those codes (200, 500, etc) are not "error codes" they are HTTP status codes, and are part of a well established standard. These do not come from HTTPAPI, they are sent over the network from the server it is communicating with.
Post Reply