Tagged Questions
0
votes
0answers
28 views
MVC Web API POST request not working from client application but working from chrome Postman extension
I have a web API service with the controller as follows.
RoutePrefix("api/Product")]
public class ProductController : ApiController
{
[HttpPost]
[POST("InsertProduct")]
public ...
1
vote
1answer
44 views
attribute routing aspnet web api not working
I'm new with attribute routing with aspnet web api.
public class UsersController : ApiController
{
[GET("users/me/brands/{id}")]
public IEnumerable<Brand> GetBrands(long id)
{
...
0
votes
1answer
57 views
Overload WebAPI controller action doesn't work with viewmodels?
The following works:
public class UsageController : ApiController
{
public int GetMilk(string param1, string param2)
{
return -1;
}
public string GetBilling(string ...
1
vote
2answers
68 views
RESTful application [closed]
Roy fielding came with this idea and a lot of application is built around this.
But I am really really confused why it is called Representational state transfer.
Don't we go from one page to other ...
1
vote
1answer
69 views
Migrating WCF Services to ASP.NET Web API - reuse ServiceAuthorizationManager?
I am migrating some WCF services to Web API. Is is possible to reuse the ServiceAuthorizationManager or is it strictly for WCF?
0
votes
2answers
473 views
PostAsync HttpClient error with Web Api - System.AggregateException “A task was canceled.”
I'm trying to call PostAsync method using System.Net.Http.HttpClient from the Web API. I get the following error:
System.AggregateException "A task was canceled."
Task:
Id = 1, Status = ...
0
votes
1answer
57 views
WebAPI returning UnAuthorized if missing Header Value
Using APS.NET MVC 4 WebApi
Each request must have a Header called "version" if it doesn't or the version is too low, I need to return an UnAuthorized value to the client. I'm not sure how to send ...
1
vote
1answer
175 views
How to return deep serialized object (with complex type properties) in Asp.Net web api?
I have next classes:
public class Event
{
public int Id { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public List<ImageLink> Images { get; ...
1
vote
3answers
284 views
.net web api updating model on PUT
So I'm trying to update a model. Here's how my models are set up:
public class Event{
public int Id {get;set;}
public string Name {get;set;}
public DateTime Date {get;set;}
public int ...
0
votes
1answer
132 views
Unable to throw httpResponseException
When I try to throw the below forbidden ResponseException from my controller. An exception stating "Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by ...
0
votes
0answers
47 views
How easy it would be for an asp.net web api running in mvc to be invoked externally?
I checked the answer provided in
mvc-4-vs-wcf-web-api
For the answer given,
the WebApi does not use SOAP, it does not require a WSDL, and does not export one. You can use Hypermedia to return ...
0
votes
1answer
224 views
Convert MVC WebAPI controller to WCF service
I have to replicate a MVC4 WebAPI application but mine will just echo the data being sent to it, so I'm wondering if I should just go with a simpler WCF service, because MVC4 WebAPI application has ...
2
votes
3answers
289 views
ASP.NET Web Api Routing Customization
I have WebApi controllers that end with the "Api" suffix in their names (For ex: StudentsApiController, InstructorsApiController). I do this to easily differentiate my MVC controllers from WebApi ...
0
votes
1answer
320 views
.Net Web API SerializationException
I am writing a simple API using .Net's Web API. I have defined the following Model:
public class VehicleUpdate
{
[Required(ErrorMessage = "DealerID Required")]
public int DealerID { get; ...
1
vote
1answer
198 views
What replaced HttpOperationHandler in WCF Web API to ASP.NET Web API
In upgrading an old project that was built using WCF Web API to now use ASP.NET Web API, I have run into a few classes that implement HttpOperationHandler<HttpRequestMessage, T>. I'm unable to ...