Azure Mobile Service - Consume POST Operation With Complex Type Parameter -


i have created custom controller following method:

// post api/customlogin public htpresponsemessage post(loginrequest loginrequest) {      // ... } 

where loginrequest is:

public class loginrequest {     public string username { get; set; }     public string password { get; set; } } 

how can use microsoft.windowsazure.mobileservices.mobileserviceclient consume operation? expecting use invokeapiasync can see 2 overrides, neither of allow me pass content in request message.

you should able like:

var loginparams = new loginrequest() { ... }; var result = await client.invokeapiasync<loginresult, string>("customlogin", loginparams); 

any 1 of these give options control request content, first 1 giving complete control on content & response.

public async task<httpresponsemessage> invokeapiasync(string apiname,    httpcontent content, httpmethod method, idictionary<string, string>    requestheaders, idictionary<string, string> parameters)  public async task<u> invokeapiasync<t, u>(string apiname, t body,    httpmethod method, idictionary<string, string> parameters)  public async task<jtoken> invokeapiasync(string apiname, jtoken body,       httpmethod method, idictionary<string, string> parameters) 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -