Page 1 of 2
using the "Where" in distinct query
Posted: Sun Feb 08, 2015 4:07 pm
by Spark Chao
my collection like below.
I follow your tutorials to set the POST service and "where" parameter,also return the localstorage variables from previous page.
If user select Asia,it will show country"Taiwan"、"Japan"、"Hongong" ,besides "Europe1".
did I set something wrong?
thanks!!
using the "Where" in distinct query
Posted: Sun Feb 08, 2015 6:46 pm
by M&M
You are querying right? Then your Method should be GET and not POST.
For testing use a hard coded value for where parameter and check the result. Once it is confirmed that it works, then substitute the variable or use the value from a UI / Input component
using the "Where" in distinct query
Posted: Mon Feb 09, 2015 5:27 am
by Yurii Orishchuk
Hi Spark,
You have two solutions:
Use "GET" method instead of "POST".
If you want to use "POST" method - move "where" request parameter to "body" section of the request tab.
Regards.
using the "Where" in distinct query
Posted: Mon Feb 09, 2015 5:34 am
by Spark Chao
Yurii
Thanks for your help!!!
I will try it later,and will let you know does it work!!!
using the "Where" in distinct query
Posted: Mon Feb 09, 2015 7:03 am
by Spark Chao
Yurii
Thanks for your help.
It is work!!
using the "Where" in distinct query
Posted: Mon Feb 09, 2015 11:26 am
by Spark Chao
Yurii
I try it by " GET" way,it will show error message like below.
{
"status":400,
"uri":"https://api.appery.io/rest/1/db/colle...",
"response":{
"code":"BCXX002",
"description":"Cannot consume content type"
}
}
One more thing need your help,when I gat the response value like Japan,can I also get another column's info of the same value?
using the "Where" in distinct query
Posted: Tue Feb 10, 2015 3:52 am
by Yurii Orishchuk
Hi Spark,
Please check if you have in "get" method in request-headers "content-type" header - delete it.
Also if you still have this problem show us your service all tabs screen shots.(request tab subtabs too).
Thanks.
using the "Where" in distinct query
Posted: Tue Feb 10, 2015 7:33 am
by Spark Chao
1、settings
2、Request Headers
3、Request Query String
4、Response Body
5、test
using the "Where" in distinct query
Posted: Tue Feb 10, 2015 9:33 am
by M&M
If you are testing it on your browser you need to enable appery proxy
using the "Where" in distinct query
Posted: Wed Feb 11, 2015 5:41 am
by Yurii Orishchuk
Hi Spark,
Please follow this solution:
Open service "request tab".
Open "headers" subtab.
Add there following parameter:
Content-Type application/json
Details: http://prntscr.com/63o6nb/direct
Regards.