Page 1 of 1

JSON Request in Appery

Posted: Tue Sep 16, 2014 2:14 am
by abigdreamer

The JSON documentation says I use a format like below to request info. How do I format this into a request in Appery? I think its a POST

{
"auth":"Your API Key",
"method":"MethodName",
"params": {
"paramName":"paramValue",
"paramName2":"paramValue2",
},
"returnFormat":"optional"
}


JSON Request in Appery

Posted: Tue Sep 16, 2014 2:15 am
by abigdreamer

FYI there was a URL linked to a PHP file -- in the beginning. I have the api key and sample methods and parameters.


JSON Request in Appery

Posted: Tue Sep 16, 2014 9:02 am
by Kateryna Grynko

Hi Mike,

Yes. Please specify these service parameters:

method:post
Data Type:json
Content Type: json

Where auth, method etc are service request parameters.


JSON Request in Appery

Posted: Fri Oct 02, 2015 7:44 am
by zaik

I am unable to receive POST values in my webservice.

The empty array is against print_r($_POST);

and other are messages shiown in $_POST is empty.

It worked correctly when i change REQUEST CONTENT TYPE to x-www-form-urlencoded.

I want to use $_POST in it.

Image Image


JSON Request in Appery

Posted: Fri Oct 02, 2015 10:33 am
by Serhii Kulibaba

Hello,

Please check this code:

pre$parameters = json_decode(file_get_contents('php://input'));
print_r(parameters);/pre