Dodsworth
asked on
Azure Custom API with Parameters
As the title says.
Hi. I'm trying to pass parameters to an Azure Mobile Servce Custom API.
Client I have..
Server I have..
The call completes but always returns False as if the parameter is not being read.
Any ideas ?
But the parameter is never evaluated it seems ?
Hi. I'm trying to pass parameters to an Azure Mobile Servce Custom API.
Client I have..
Dim result = Await App.MobileService.InvokeApiAsync("apitest", System.Net.Http.HttpMethod.Post, New Dictionary(Of String, String) From {{"Param1", "Value1"}, {"CompleteAll", "true"}})
MessageBox.Show(result.ToString)
Server I have..
exports.post = function(request, response)
{
if (request.parameter.CompleteAll == "true")
{
response.send(statusCodes.OK, { message : 'True' });
}
else
{
response.send(statusCodes.OK, { message : 'False' });
}
};
The call completes but always returns False as if the parameter is not being read.
Any ideas ?
But the parameter is never evaluated it seems ?
ASKER
The parameter is Dictionary(Of String, String)
force it to check what you receive :
exports.post = function(request, response)
{
response.send(statusCodes.OK, { message : request.parameter.CompleteAll, typeOf:typeof request.parameter.CompleteAll });
};
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorted. Thanks for the code that helped me diagnose the problem. I tries sharing some points but it didn't work :( I needed to ensure the answer marked was correct.
and not a boolean : << == true >>
Open in new window