Azure Mobile Services User API Getting customer inconvenience

So, I am using azure mobile services backend to create a custom API. However, I cannot even connect to the template table with the client. When you create a new Azure Mobile Service using a template, they provide you with this API valuesthat resembles this format

[MobileAppController]
public class ValuesController : ApiController
{
    // GET api/values
    [Route("api/values")]
    public string Get()
    {
        return "test";
    }
}

From the client, I try to call this endpoint like this

var result = mobileService.InvokeApiAsync<string>("values", HttpMethod.Get, null).Result;

And for some reason I get this exception

{"The request could not be completed. (Bad Request)"}

{Method: GET, RequestUri: 'http://localhost:58457/api/values', Version: 1.1, Content: <null>, Headers: { X-ZUMO-FEATURES: AT X-ZUMO-INSTALLATION-ID: b04f4e19-4f41-46ed-9767-9c1352037559 Accept: application/json User-Agent: ZUMO/1.3 User-Agent: (lang=Managed; os=Windows; os_version=6.1.65536.7601; arch=Win32NT; version=1.3.30324.0) X-ZUMO-VERSION: ZUMO/1.3 (lang=Managed; os=Windows; os_version=6.1.65536.7601; arch=Win32NT; version=1.3.30324.0) }}

This is also a template, so I need this to work before I start and run any of my user endpoints. Any ideas on what could be the issue?

+4
4

, , , MobileAppController.

, Mobile App. server.config , - .

 <package id="Microsoft.Azure.Mobile.Server" version="1.0.119.0" targetFramework="net45" />

, 400, Mobile Client 2.0.0.

, :

<package id="Microsoft.Azure.Mobile.Client" version="2.0.1" targetFramework="win81" />

400, . , - :

{"message":"No API version was specified in the request, this request needs to specify a ZUMO-API-VERSION of '2.0.0'.  For more information and supported clients see: http://go.microsoft.com/fwlink/?LinkId=690568#2.0.0"}
+3

, true MS_SkipVersionCheck. web.config, " " Azure Portal. enter image description here ms_skipversioncheck true .

+11

, , .config, - Bad Request. Zumo. InvokeApiAsync , . :

var arguments = new Dictionary<string, string>
            {
                {"ZUMO-API-VERSION", "2.0.0" }
            };
var result = MobileService.InvokeApiAsync<string>("CONTROLLERSNAME",  "HttpMethod.Get", arguements).Result;

.

0

https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-client-and-server-versioning

, SDK , . SDK SDK . , SDK, ZUMO-API-VERSION.

,

HEADERS: ZUMO-API-VERSION: 2.0.0

http://localhost/api/values/get?ZUMO-API-VERSION=2.0.0

, true MS_SkipVersionCheck, web.config

0

Source: https://habr.com/ru/post/1628646/


All Articles