Hello Aeneas,
We are very sorry for delay, we are working on your request and try to post and update later today.
Hello Aeneas,
We are very sorry for delay, we are working on your request and try to post and update later today.
Hello,
1) For xhr2 you are receiving it as binary
2) Your next line: var request
this object doesn't have anything saying about type
Hi, thats just a variable used in this line
var XHRResponse = XHR2.send("POST", url, request)
How should I put type into this variable to pass to next xhr2 request? Aeneas
Same as you did for GET request including a parameter Content-type inside.
With a proper types, that should be a type of file content, what ever it is.
The first requestbody is not actually being used in the first request. When I add
"Content-type": "application/png"
to the post requst I still get
{"code":"BCXX002","description":"Cannot consume content type"}
The actual code I am using is.....
var url = "http://api.page2images.com/directlink..."
var XHRResponse = XHR2.send("GET", url);
response.success(XHRResponse.body, "application/text");
var res = XHRResponse.body
console.log(res);
url="https://api.appery.io/rest/1/db/files"
var request = {
"headers": {
"X-Appery-Database-Id": "53bf19xxxxx",
"X-Appery-Master-Key": "e9cfa46xxxxxx",
"Content-type": "application/png"
},
"data": res
};
var XHRResponse = XHR2.send("POST", url, request);
response.success(XHRResponse.body, "text/plain");
console.dir(XHRResponse);
Hello Aeneas,
We are very sorry for delay. Could you please instead of sending with xhr2 method of saving in Appery.io db try to use functions designed to work with DB?
http://devcenter.appery.io/documentat...
Hi, is there any documentation on this available now?
I tried this solution and it doesn't work
Hello Malgorzata, this is purely a web client-side JavaScript implementation and the example above was posted 3 years ago. You can use a client-side JS library nowadays for such purposes I believe, please search for appropriate solution in the internet.