Support for *PUT Request Type

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
jjacobs207
Posts: 20
Joined: Mon Aug 07, 2023 5:59 pm

Support for *PUT Request Type

Post by jjacobs207 »

Could HTTPAPI be enhanced to support the *PUT request type? Please elaborate on what would be required to do this.
Scott Klement
Site Admin
Posts: 979
Joined: Sun Jul 04, 2021 5:12 am

Re: Support for *PUT Request Type

Post by Scott Klement »

HTTPAPI already supports PUT requests.

Use one of http_req(), http_string() or http_stmf() routines. Whichever one meets your needs.
jjacobs207
Posts: 20
Joined: Mon Aug 07, 2023 5:59 pm

Re: Support for *PUT Request Type

Post by jjacobs207 »

My version of HTTPAPI command does not support *PUT Request Type. How do you mean that the utility supports it?
Scott Klement
Site Admin
Posts: 979
Joined: Sun Jul 04, 2021 5:12 am

Re: Support for *PUT Request Type

Post by Scott Klement »

HTTPAPI added support for the PUT request type in 2013. If you really don't have a version capable of using it, then you are VERY VERY far behind and succeptable to many security bugs, you need to update badly.

For example:

Code: Select all

dataReceived = http_string( 'PUT: url: dataToSend: 'application/json');
jjacobs207
Posts: 20
Joined: Mon Aug 07, 2023 5:59 pm

Re: Support for *PUT Request Type

Post by jjacobs207 »

I am using HTTPCMDR4. What is the current version?
Scott Klement
Site Admin
Posts: 979
Joined: Sun Jul 04, 2021 5:12 am

Re: Support for *PUT Request Type

Post by Scott Klement »

Ahhhh, you are using the command interface for HTTPAPI, that's why I didn't understand you.

The current version is 1.53

The command interface hasn't been updated to support methods other than GET or PUT at this time. It could be updated, but hasn't been -- not many people use it (which makes me sad.)

I can look into adding support.
jjacobs207
Posts: 20
Joined: Mon Aug 07, 2023 5:59 pm

Re: Support for *PUT Request Type

Post by jjacobs207 »

I am using the command interface with the code behind only implemented currently for *GET and *POST. A version supporting *PUT would be greatly appreciated. I have an application requirement where APIs are called in a sequence of four steps. 1. GET. 2. POST. 3. PUT. 4. POST. Without the PUT functionality in HTTPAPI, we would alternately use 3rd party middleware to code the application instead. Let me know. Thanks!
Post Reply