Page 1 of 1

servercode test using x-www-form-urlencoded = status":"400 Bad Request / code:BCXX002

Posted: Wed Apr 16, 2014 11:06 am
by Dupdroid

I'm getting an error trying to test a basic server code script using x-www-form-urlencoded:

{
"status":"400 Bad Request",
"url":"https://api.appery.io/rest/1/code/593...",
"response":{
"code":"BCXX002",
"description":"Cannot consume content type"
}
}

server code script =

var body = request.body(); //Saving the request body
var name = request.get("name"); //Saving the request parameter "name"
response.success(name + ":" + "\n" + body); //Output them both

What am I doing wrong?

Image

Image

Image

Image


servercode test using x-www-form-urlencoded = status":"400 Bad Request / code:BCXX002

Posted: Wed Apr 16, 2014 1:12 pm
by Kateryna Grynko

Hi,

Does your code work properly here https://appery.io/servercode/ ?


servercode test using x-www-form-urlencoded = status":"400 Bad Request / code:BCXX002

Posted: Wed Apr 16, 2014 1:16 pm
by Dupdroid

Yes it does.


servercode test using x-www-form-urlencoded = status":"400 Bad Request / code:BCXX002

Posted: Wed Apr 16, 2014 4:50 pm
by Maryna Brodina

Hello!

Unfortunately you can't send request to appery.io server code with content type application/x-www-form-urlencoded