http "PATCH" method
Posted: Tue Sep 23, 2025 6:15 pm
I've run into my first requirement of an API that requires "PATCH" instead of "post". So I Googled the following in AI_mode: on IBM i in ILERPG using Scott Klement's HTTPAPI service program, is it possible to use PATCH instead of POST.
It said, Yes! Use http_xproc() with HTTP_POINT_SET_METHOD constant to specify "PATCH" as the method to be used. The you can use http_url_post() and it will use the PATCH method instead of post.
So I said, Sweet! that's easy! Well, it lied
There is no HTTP_POINT_SET_METHOD constant.
So the question remains, is there a way to use PATCH with http_url_post() ? Or another way to send a JSON body with a bearer token authorization?
What I had hoped for was the following:
It said, Yes! Use http_xproc() with HTTP_POINT_SET_METHOD constant to specify "PATCH" as the method to be used. The you can use http_url_post() and it will use the PATCH method instead of post.
So I said, Sweet! that's easy! Well, it lied

So the question remains, is there a way to use PATCH with http_url_post() ? Or another way to send a JSON body with a bearer token authorization?
What I had hoped for was the following:
Code: Select all
http_setCCSIDs( 1208: 0 );
http_setauth(HTTP_AUTH_BEARER : ' ' : bearerToken);
http_xproc(HTTP_POINT_SET_METHOD: 'PATCH');
rc = http_url_post( url
: %addr(jsonBuf : *data)
: %len(jsonBuf)
: ifsResp
: HTTP_TIMEOUT
: HTTP_USERAGENT
: 'application/json');