Page 1 of 1

Complicated REST POST using Services UI

Posted: Fri Aug 30, 2013 3:20 pm
by Andrew J Evangelos

I am trying to use a POST under the REST services and I have a lengthy body (few hundred parameters) that needs to accompany the headers. Is there an easier way to quickly import the JSON for the body besides using the builder? I saw this was possible with the response body, by importing a response received.


Complicated REST POST using Services UI

Posted: Fri Aug 30, 2013 3:45 pm
by Serhii Kulibaba

Hello Andrew!
It is imposible to import request parameters from json by Appery IU.


Complicated REST POST using Services UI

Posted: Fri Aug 30, 2013 4:27 pm
by Serhii Kulibaba

You can use request parameters from json by executing you REST Service from code:

preservice_name.execute({

success: function( PlainObject data, String textStatus, jqXHR jqXHR ) {
//Success handler here
},

error: function( jqXHR jqXHR, String textStatus, String errorThrown ) {
//Error handler here
},

complete: function( jqXHR jqXHR, String textStatus ) {
//Complete handler here
},

data: { object with request params },
headers: { object with request header params }
});/pre

You can replace any parameter and handler to yours. (They are not required)
Thus you can control request at runtime.