Quantcast
Channel: Web API
Browsing all 4850 articles
Browse latest View live

Generating API token randomly

Hi,can anybody help me how to randomly generate a token for certain user to be allowed to use the API? And than every time the user tries to use the API he/she should use this token and be validated on...

View Article


pass custom error from web api to client

I am running a web api 2.2  app,  & getting it to throw an exception.   Debugging the api,  I can see it is throwing the error with the correct custom error message. Eg "Only Zoo keepers can feed...

View Article


Reusing same HttpClient fails

So this is pretty much the error I get:An unhandled exception has occurred while executing the request. System.InvalidOperationException: This instance has already started one or more requests....

View Article

angularjs get response from IHttpActionResult

hello all,i have a api project, i use it to communicate with database, UI project accessing api project and read/write data. my doubt is, im calling API from angular js, how do i receive API message...

View Article

Angular Js Version and Visual Studio Version

Hi everyone! I have got an assignment to implement CRUD and some other functionalities. Stack is .Net MVC 5, Web API and Angular Js of my choice (between 2,4 or 5). I am very new to angular js and...

View Article


How to accept JSON and XML both in Web API post method

Hi All,I have written Web API code and my web service is able to accept JSON data sent from Advanced REST Client (Chrome app)But unfortunately I am unable to get XML data on my web service POST method....

View Article

Web Api Hosting using Service Bus

Hi All,I have a Web api which is self hosted. I want create two Host one using Azure Service Bus and second localhost.I followed below link to host using Azure service bus but it is giving me...

View Article

ASP.NET WebAPI to use ServiceBus

Can ASP.NET Web API be used to communicate with Service Bus for exhanging messages or what are the possibilities of ASP.NET Web API and Service Bus together. Thanks in advance. 

View Article


ODataController in WebAPI with Custom Entity

Hi,Am having a table with one column say Code (With this one column I want to create a custom entity with 3 columns and build a JSON is the requirement).. I created a Custom Entity like belowClass...

View Article


Not able to debug or hit the particular action method in controller.

Hi There,I have my Web API service installed in local machine and deployed in IIS server. I am using postman to call the action method of the web api controller. For this I have put the breakpoint at...

View Article

Can I enable OData Query pagination with a method that returns DataTable?

Hi All,I am very new to developing services with WebAPI, and have been tasked with converting our existing ASMX service to RESTful (read it as writing a WebAPI2 layer)... :PI have the Get method...

View Article

404 Not Found error when calling a Web API via jQuery

I have been dealing with a "404 Not Found" error when calling a Web API in an ASP.NET MVC project for some time and I just do not find the problem. This is the second Web API that I write and I had the...

View Article

Object is null from Postman with Post Method

I have this:[Route("api/[controller]")]public class OptoutClientController : Controller{    HttpClient client = new HttpClient();    [HttpPost]    public IActionResult...

View Article


Hosting WebAPI service and Angular WebAPP in the same host

Ideally Web API services should be hosted on a host and your web application should be on different one. But due to resource constraints i want to host my API service and Angular UI on the same host.Is...

View Article

How to Handle created class instances (objects) properly?

I am trying to have my tasks return same object response instead of having each one with a different return. I wrote the following class, public class ApiMethodResult : IDisposable { public...

View Article


Only Data is coming not keys in Json format

Hi All,Below is my controller (REST API) to get the data from database.public JArray Post(FormatQuestionBySetId data) { ArrayList Objdata = new ArrayList(); string ques = string.Empty; string[] myArray...

View Article

Not finding an action in the controller

I am not finding one of the actions in my security controller.  I keep looking for a typo but don't see one.here are my route statements in Global.asax.csvoid Application_Start(object sender, EventArgs...

View Article


Getting external authentication token for API

Hi,I need to use userID and Password or security key that is passed for authentication by external client company's web application to use my API. So, I am interested only for the server side, only to...

View Article

Passing complex and simple type parameters in API

Hi,I created an object that wraps two parameters, one of simple and one of complex type. I use two classes for the request and response.The example that helped me with this is on this web...

View Article

Image may be NSFW.
Clik here to view.

Web Api 2 project - cant run it, Parse error, tried multiple solutions

Hello,I am receiving following error when trying to run my web api 2 web api:I am so tired of this error, ive tried like all of the solutions from...

View Article
Browsing all 4850 articles
Browse latest View live