TSNet updated to include PUT and PATCH
ivara
ivar.andreassen at gmail.com
Sat May 5 17:19:39 EDT 2018
Hello,
Glad i finally found some information about PUT in a html method (not the
put something into another object).
The current challange:
-> Working with a solution that requires me to write a desktop / app that
communicates with REST API.
-> POST is the starting point, and the values sent to the REST API is
accepted in this case the order in a purchase is created.
-> The second part that is required is to issue a PUT statement with the
total amount for the order ( a numeric value).
-> POST and GET is a no brainer in livecode, but how the h#ยค%% do I send a
PUT the the REST API to update the processing ID and total amount for the
order?
Tested in Postman and this code works like a charm: (notibly the auth key is
scrambled, but it is working)
PUT /payments/1140066900/link HTTP/1.1
Host: api.quickpay.net
accept-version: v10
Content-Type: multipart/form-data; boundary=----MyTest001
Authorization: Basic OjM4MT.......
Cache-Control: no-cache
Postman-Token: 95b8e245-0097-4559f-b936-d48e7a8927a5
------MyTest001
Content-Disposition: form-data; name="amount"
650
------MyTest001--
Tried all kinds of methods to get PUT working like e.g. the POST statement
with very similar syntax that works from Livecode, but no way.
This is the error:
{
"message": "Validation error",
"errors": {
"target_operation": [
"does not have a valid value"
]
},
"error_code": null
}
Basically it replies like this because it thinks a POST is being submitted.
Actually this is the copy paste from PostMan, but same detail in debug in
livecode after execute of the statment. And yes; the reason is that a "PUT"
statement is submitted to the REST API from livecode using "POST tBody (body
element) to url "https://...."
Don't care what method I have to use to solve this, I just need something
that works. Please help, been searching and debugging for two days now..
cheers!
Ivar
--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
More information about the use-livecode
mailing list