Page 1 of 1

REST API & Sever code Service

Posted: Wed Nov 09, 2016 9:48 am
by Amirul Momenin

Image

I am trying to passe Binary image data by REST API & Sever code Service

png & gif is passing good
only problem with jpeg
why is this occurring?


REST API & Sever code Service

Posted: Wed Nov 09, 2016 10:09 am
by Amirul Momenin

414 Request-URI Too Large


REST API & Sever code Service

Posted: Wed Nov 09, 2016 1:20 pm
by Serhii Kulibaba

Hello Amirul,

Please clarify, how do you send that value? Through a POST body parameter? Please send it there.


REST API & Sever code Service

Posted: Fri Nov 11, 2016 11:04 am
by Amirul Momenin

Yes as POST.small content is passing but large


REST API & Sever code Service

Posted: Fri Nov 11, 2016 8:22 pm
by Amirul Momenin

REST API & Sever code Service

Posted: Sat Nov 12, 2016 1:16 pm
by Amirul Momenin

I am splitting the data and passing
How may I do this sync
I notice stored data is random

function chunkString(str, len) {
var _size = Math.ceil(str.length/len),
ret = new Array(size),
_offset
;

for (var _i=0; _i,VideoData);
restservice_adpost_video.execute({});
}
*/
}


REST API & Sever code Service

Posted: Mon Nov 14, 2016 9:43 am
by Serhii Kulibaba

According to the screenshot above - you send that value in the URL (as a Query String parameter). Please use a request body for that. Image


REST API & Sever code Service

Posted: Fri Nov 18, 2016 4:26 am
by Amirul Momenin

Can you say how may i catch this Body data to Server code?
Look the data variable
I think this is not actual way
let me know how to set
var url = "http://hadaj.com/_scripts/rest-api/se...";

var responseBody = {};
var requestParams = {};
var paramKeys = request.keys()
for (var key = 0; key < paramKeys.length; key++) {
requestParams[paramKeys[key]] = request.get(paramKeys[key]);
}

//var ad_id = requestParams['ad_id'];
//var image = requestParams['image'];

data = requestParams['data'];

var XHRResponse = XHR2.send("GET", url, {
"parameters": {

},
"headers": {
"header1": "value1",
"header2": "value2",
},
"body": data
}

);

Apperyio.response.success(XHRResponse.body, "application/json");


REST API & Sever code Service

Posted: Mon Nov 21, 2016 7:32 pm
by Serhii Kulibaba

You can read a request body parameter with a method request.body():
https://docs.appery.io/reference#serv...