I have a RESTful web service with this format:
/users?age={age}
As it is defined, the web service works whether I add age parameter or not. So both examples are correct:
/users
or
/users?age=18
The amplify's request definition:
amplify.request.define( "usersService", "ajax", {
url: "/users",
type: "GET",
data: {age : "{age}"}
});
Invocation that works:
var myAge = 18;
amplify.request("usersService", {age : myAge});
Result is:
GET /users?age=18
Response code: 200 OK
Invocation that does not work:
var myAge = null;
amplify.request("usersService", {age : myAge});
Result is:
GET /users?age=
Response code: 400 BAD REQUEST
The correct result I was expecting when age is not defined is:
GET/users
Response code: 200 OK
Any idea how to make this example works?
Thanks in advance. Regards Neuquino