1

Whenever I am running my web api service I am getting below response

No HTTP resource was found that matches the request URI 'http:/xxxxxxxxxxx/api/values/Signup_v3?RefferalCode="4566"&Emailid=pavan@fffffmmm&Password=44444444&DeviceID=sdsdsd&PlatformID=3&DeviceToken=dsfnjdsdfkj&Mobilemodel=nojik&Appversion=2.2&MobileOS=hjkdd'.

my service is :

 [AcceptVerbs("GET","POST")]
 public HttpResponseMessage Signup_v3(string RefferalCode, string EmailID, string Password, string Mobile, string UserName, string DeviceID, int PlatformID, string DeviceToken, string Mobilemodel, string Appversion, string MobileOS)
 {
 }

my webapiconfig file is:

public static void Register(HttpConfiguration config)
        {
            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{action}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );

please help me.

4
  • remember id is your route parameter. A better approach is to create a POCO class with all those properties and then post as a single object. Oct 27, 2015 at 7:41
  • You are not providing username and mobile in your url. Thats causing problem Oct 27, 2015 at 7:52
  • @VIVEK Yes I got the answer
    – Anil Kumar
    Oct 27, 2015 at 7:57

1 Answer 1

0

You should post/Get with complete paramters:

api/Values/Signup_v3?RefferalCode={RefferalCode}&EmailID={EmailID}&Password={Password}&Mobile={Mobile}&UserName={UserName}&DeviceID={DeviceID}&PlatformID={PlatformID}&DeviceToken={DeviceToken}&Mobilemodel={Mobilemodel}&Appversion={Appversion}&MobileOS={MobileOS}

For example like this:

http://localhost:6642/api/Values/Signup_v3?RefferalCode=12&EmailID=12&Password=12&Mobile=12&UserName=12&DeviceID=1&PlatformID=1&DeviceToken=15&Mobilemodel=345&Appversion=4&MobileOS=4

Or Use default value.

5
  • Please past this address and test it: api/Values/Signup_v3?RefferalCode=12&EmailID=12&Password=12&Mobile=12&UserName=12&DeviceID=1&PlatformID=1&DeviceToken=15&Mobilemodel=345&Appversion=4&MobileOS=4
    – user1968030
    Oct 27, 2015 at 7:43
  • In the above service 11 parameters are there.is there any problem
    – Anil Kumar
    Oct 27, 2015 at 7:43
  • But in your question you post just 7 parameters
    – user1968030
    Oct 27, 2015 at 7:45
  • sorry. I got the answer
    – Anil Kumar
    Oct 27, 2015 at 7:48
  • @AnilKumar.Ok no problem
    – user1968030
    Oct 27, 2015 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.