Quantcast
Channel: asp.net-web-api2 – HTML CODE
Viewing all articles
Browse latest Browse all 10

Passing parameter from angular js for a POST web api method

$
0
0

Passing parameter from angular js for a POST web api method

i have used sample code upload control.

web api phone call angularjs controller given below

the post web api method

in browser, fileuploader obj had below info along others

the phone call works fine if remove seldoctype paramter( in api controller).
when seek add together parameter, api phone call not happen.
i assuming not passing parameter in right way. can please help.

thanks

you need have object post method argument instead of string.

first create class seldoctype propery , maintain class argument of post method.

class document { public string seldoctype {get;set;} }

now utilize class in post method argument

[system.web.http.httppost]
public ihttpactionresult uploadfile(document document)
{..}

post method takes object type parameter.

angularjs http-post asp.net-web-api2

The post Passing parameter from angular js for a POST web api method appeared first on HTML CODE.


Viewing all articles
Browse latest Browse all 10

Trending Articles