Hello,
I've been researching a way to send a PATCH request and have been coming up short. Is there an example someone can share? I'm using the libSOAP library and while it has been working well with post requests I'm uncertain if I can leverage it for patch requests as well.
Thanks in advance.
Send PATCH requests in lieu of POST
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Send PATCH requests in lieu of POST
Well, as the author of the libSOAP library I suppose I should chime in here with something. I have to say that I haven't looked at that code in several years now, but...
The libURL library that underlies all the http code supports the GET, POST, PUT, and DELETE verbs. You'd have to er... patch... the library to add PATCH to the supported http verbs and then add the patchUrl handler to the library in order to have this work. Patch would be a useful addition to the libURL library, and I'd say that probably the thing to do would be to file an enhancement request and wait around for someone on the team to implement it.
I don't know if tsNet supports the PATCH verb, but if you have a Business license you might look into that.
The libURL library that underlies all the http code supports the GET, POST, PUT, and DELETE verbs. You'd have to er... patch... the library to add PATCH to the supported http verbs and then add the patchUrl handler to the library in order to have this work. Patch would be a useful addition to the libURL library, and I'd say that probably the thing to do would be to file an enhancement request and wait around for someone on the team to implement it.
I don't know if tsNet supports the PATCH verb, but if you have a Business license you might look into that.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Send PATCH requests in lieu of POST
Thanks for the reply!
I imagine the other way to issue the PATCH request would be to call curl within my application. Not a problem as I've done this before. I'll also file an enhancement request as I do believe adding PATCH to the existing http verbs would be beneficial.
I imagine the other way to issue the PATCH request would be to call curl within my application. Not a problem as I've done this before. I'll also file an enhancement request as I do believe adding PATCH to the existing http verbs would be beneficial.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Send PATCH requests in lieu of POST
yeah, shelling out to curl (although I prefer httpie) would also do the job as long as you take care package up the parameters properly. And you'd get results much faster than waiting for an enhancement request to be fulfilled.
Post the bug report number here when you've filed it. I'll add my two cents' worth.
Post the bug report number here when you've filed it. I'll add my two cents' worth.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 76
- Joined: Tue Mar 05, 2013 7:00 pm
- Location: Berlin
- Contact:
Re: Send PATCH requests in lieu of POST
You can try to set the Header:
"X-HTTP-Method-Override: PATCH"
And then send a post request with this Header set
"X-HTTP-Method-Override: PATCH"
And then send a post request with this Header set