Page 1 of 2

REST Service working in Fiddler but not in Appery

Posted: Thu Aug 08, 2013 9:53 pm
by Ravi Wayne

I have a simple rest service to post data to a table. I am able to successfully use it from fiddler, but get an error from Appery when testing. I have tried with and without proxy. For date, I am using the JSON format as a input e.g, \/Date(928164000000-0400)\/. Tried different combinations here, but could not solve the issue. Any thoughts/suggestions?


REST Service working in Fiddler but not in Appery

Posted: Thu Aug 08, 2013 10:01 pm
by Alena Prykhodko

Hello Ravi!

What response do you get? Send us screen shots,
Please provide steps to reproduce.


REST Service working in Fiddler but not in Appery

Posted: Thu Aug 08, 2013 10:15 pm
by Ravi Wayne

Please see error below. Can I email the url and screen print information to an e-mail address?

{
"status":"400 Bad Request",
"url":"xxxxxx/xxxService/",
"response":"
}


REST Service working in Fiddler but not in Appery

Posted: Thu Aug 08, 2013 10:17 pm
by Alena Prykhodko

Of course, email to a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a.


REST Service working in Fiddler but not in Appery

Posted: Thu Aug 08, 2013 10:37 pm
by Ravi Wayne

I sent a email. Thank you.


REST Service working in Fiddler but not in Appery

Posted: Thu Aug 08, 2013 10:55 pm
by Alena Prykhodko

Thank you. I'll test and update.


REST Service working in Fiddler but not in Appery

Posted: Fri Aug 09, 2013 12:27 am
by maxkatz

There is an issue on our side with the request being send as all strings when setting default values in service. Instead, set the values in mapping and test the service from the page:

This is how the service request looks:
Image

This is how the mapping looks:
Image

For JavaScript, you would define:

code
return 1;
/code
or
code
return " \ / Date(928164000000-0400) \ / &quot
/code
(I put the extra spaces for formatting only on the forum)

Make sure you have the proxy on.

We already have plans to add data type when defining service request.

To create the response, you can do this: http://docs.appery.io/documentation/r...


REST Service working in Fiddler but not in Appery

Posted: Fri Aug 09, 2013 9:28 pm
by Ravi Wayne

Thank you very much for your response. This works as illustrated above. However, I am hard coding the date values. Is there a way to convert the date input to json type in the java script? We found some examples to do this, but they require references to other java script libraries. Can we add our own java script library?

Thank you.


REST Service working in Fiddler but not in Appery

Posted: Fri Aug 09, 2013 9:32 pm
by maxkatz

Sure, you can do some basic string manipulation/formatting. You should need any special libraries.


REST Service working in Fiddler but not in Appery

Posted: Fri Aug 09, 2013 9:35 pm
by Ravi Wayne

Do you have any examples? Does the data control returning a value of type date or string? We tried javascript examples to convert date to json unsuccessfully.