West Wind Internet and Client Tools
HTTP PATCH request
Gravatar is a globally recognized avatar based on your email address. HTTP PATCH request
  Robert
  All
  Apr 18, 2019 @ 10:49am

I am utilizing an API in VFP using the WW Internet and Client Tools to get orders from on online ordering system. I am successfully using the POST command to login into the online portal and GET commands to retrieve new orders. However, I need to use the PATCH command to update an order status and I am not having much luck getting this to go through. Are PATCH commands implemented or do you have suggestion on how to add this in VFP using the client tools in wwHTTP?

e.g. sample c# code

var client = new RestClient("http://api.apidomain.com/api/rest/v001/group/3/order_management/order/224/?{'order_status': 'pickup_ready'}=&{%27order_status%27:%20%27pickup_ready%27}=");
var request = new RestRequest(Method.PATCH);
request.AddHeader("cache-control", "no-cache");
IRestResponse response = client.Execute(request);
Gravatar is a globally recognized avatar based on your email address. re: HTTP PATCH request
  Rick Strahl
  Robert
  Apr 18, 2019 @ 01:12pm

You can use any verb with wwHttp using the cHttpVerb property.

loHttp = CREATEOBJECT("wwHttp")
loHttp.cHttpVerb = "PATCH"
...

*** Use the 'generic' HttpGet() method
lcResult = loHttp.HttpGet(lcUrl)

+++ Rick ---

© 1996-2019