javascript - Is there an Ajax call generator from webapi -


i'm writing web api c# code, i.e:

public void post([frombody]list<imagemodel> images,string id) {    

where imagemodel is:

public class imagemodel {     public string filename { get; set; }      public bool isapproved { get; set; }      public [another object...] cropped { get; set; }  }    

i'm looking tool generate ajax call example given code above or other webapi code.

you can create pages api methods.

follow below steps adding pages in web api application:

from tools menu, select library package manager, , select package manager console. in package manager console window, type 1 of following commands:

for c# application: install-package microsoft.aspnet.webapi.helppage visual basic application: install-package microsoft.aspnet.webapi.helppage.vb 

also, make sure register areas. in global.asax file, add following code application_start method, if not there already:

protected void application_start() {     // add code, if not present.     arearegistration.registerallareas(); } 

adding api documentation: config.setdocumentationprovider(new xmldocumentationprovider( httpcontext.current.server.mappath("~/app_data/xmldocument.xml")));

to add simple test client asp.net web api page follow below steps:

step 1: install test client package install webapitestclient package nuget package manager. make sure “include prerelease” type in “webapitestclient” , click install.

step 2: wire test client on page open file api.cshtml (under areas\helppage\views\help) , add following:

@html.displayformodel("testclientdialogs") @html.displayformodel("testclientreferences") 

now run application , test api using ajax call of test client.

for refer creating pages asp.net web api

after adding simple test client asp.net web api page

this give test client test api's using ajax requests.

please let me know, works you.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -