3
votes
1answer
32 views

ASP.NET MVC4 Web API Controller Stuck on One Route

I created a new ASP.NET MVC4 Web Api Project. In addition to the default ValuesController, I added another controller, ScenarioController. It has the exact same methods as ValuesController. But for ...
0
votes
1answer
17 views

Document sniffing via Load<>?

I'm using RavenDb with ASP.NET Web Api and i've noticed, that it's possible to query other documents with the Load<Type> method. For example: public class Person { public string Id { get; ...
0
votes
1answer
58 views

Why is WebAPI Throwing a 'No MediaTypeFormatter' Error?

I have a strange issue happening with my WebAPI controller. In my development environment (Win7, IIS 7.5) the method on the controller is called and the result is returned as expected. In my ...
0
votes
0answers
34 views

WebApi binding a single parameter from body (form-urlencoded)

I would like to understand why in case when there is only one parameter in the POST body, for content type url-formencoded the syntax is different than in case of multiple parameters. Let's assume ...
0
votes
2answers
41 views

Default Authorization role at Controller level and override at method

I'm trying to set default access to the methods on my controller, so I've added the [Authorize] attribute on my ApiController. For the most part, unless overridden with the [AllowAnonymous] attribute ...
0
votes
1answer
20 views

WebAPI Custom ModelBinder inheritance

I am trying to bind to the parent of a certain object type using WebAPI BindParameter. I am able to bind to the object itself (SomeObject), but not its parent (SomeOtherObject). This would cause me to ...
0
votes
1answer
39 views

Where the auth cookies needs to be when you have a web api?

I have a Web Api (C# MVC4 with EF5) and want to provide data information for other applications. I'll use a type of anti relay attack sending a uniquekey as response for every request and expecting ...
0
votes
1answer
37 views

PutAsJsonAsync does not work when dto has data annotations

I'm seeing some strange behavior with HttpClient and Web API with my DTOs. When I have data annotations in place for my properties, HttpClient.PutAsJsonAsync() does not work. I can't receive anything ...
7
votes
1answer
55 views

Upload image through form post

I'm trying to upload an image through a multipart/form-data post and I'm using the code below. I'm only going to be uploading .jpg images. The problem is that the image that is saved is not a valid ...
1
vote
2answers
43 views

Counts in Breeze.js

I have a complex query that returns item counts. If I run a query on the client, will it always return the objects, or is there a way to just return the item counts without sending the object array ...
0
votes
1answer
33 views

Cannot delete database because it is in use (with Membership)

I'm trying the following in my EF codefirst Seed method: protected override void Seed(TestDbContext context) { SqlConnection.ClearAllPools(); ...
0
votes
1answer
80 views

Works for GET, not for POST (404 error)

I have a WebApi controller ServicesApiController in my MVC4 project with a signature like so: [Authorize(Roles = "sysadmin,Secretary")] [AcceptVerbs("GET", "POST")] public IEnumerable<Stock> ...
1
vote
1answer
47 views

Forms Like Authentication in WCF or Web API?

I currently have a MVC application that is using Forms Authentication. I realize that you cannot self host a MVC application. Business requirements dictate that my application has to be self hosted. ...
0
votes
1answer
26 views

HttpRequestMessage.GetClientCertificate is null when certificate is being set on client

I've set up a WebAPI service to require https and open to accept a client certificate. The SSL part is working fine. I'm using the WebRequestHandler to attach a certificate (a real one, not test ...
0
votes
1answer
36 views

Cannot serialize the derived property to JSON in Web API

I am trying to GET an object of this type (through Web API): public class Document { public int Id { get; set; } public FileFolder Folder { get; set; } public FileFolder FolderParent ...
0
votes
1answer
18 views

Wget and .net WebAPI

I created a simple restless webapi that takes a few variables and returns a simple Success or Fail This works great in Fiddler. http://www.####.com/myapi/api/SettingsConfig POST HTTP/1.1 Request ...
0
votes
1answer
36 views

How to know when a response has finished being sent to the client?

I have a Web API web method which returns a list of Events in xml: public IList<Event> GetAllEvents() { ... } public class Event { public string Name { get; set; } public int Id { ...
1
vote
1answer
36 views

How can I structure a REST API endpoints for MS Web Api cleanly?

I have a data model called PIM (Product Info Manager) that requires that I pass a company AppId for every request. So if I want to get all the products I would pass a Company AppId and the resource ...
0
votes
2answers
62 views

WebAPI not working in Fiddler

I have created a POST WebApi that i can call as follows: <script type="text/javascript"> var TheData = { Number: "7181112222", Username: "myusername", Password: "mypassword", ...
2
votes
1answer
34 views

How would I extend WebAPI to support returning controller action results via an HTTP callback?

I'm trying to extend WebAPI to support returning a response through an HTTP callback. Workflow: WebAPI receives a HTTP request with a callback URL. WebAPI handles the URL normally and if the ...
2
votes
1answer
120 views
+50

MVC WebApi endpoints do not work on production, but regular endpoints do

I have an ASP.NET MVC project that runs perfectly locally. It has some controllers that inherit from Controller and some that inherit from ApiController. My routes are below. When I run the project ...
0
votes
1answer
38 views

ASP.NET Web API Not Serializing bool fields

I have the following model class: [DataContract(Namespace = "http://api.mycompany.com/v1")] public class Job{ [DataMember(IsRequired = true), Required] public long Id { get; set; } ...
0
votes
1answer
31 views

Using Custom IHttpActionInvoker in WebAPI for Exception Handling

I'm trying to add a custom IHttpActionInvoker to my WebAPI application in order to prevent the need for lots of repeated exception handling code in my action methods. There really doesn't seem to be ...
1
vote
0answers
59 views

File not getting downloaded in Browser

I am using web api. and trying to download a file forecefully in the browser. Flowing is my code public HttpResponseMessage GetText() { try { string ...
3
votes
1answer
51 views

How to Secure WebAPI with Single-Page

I'm building an application with an MVC4 single-page front end and a WebAPI on another machine that returns json query data directly to the browser. The authentication happens on the MVC side where a ...
2
votes
2answers
53 views

Is there a way to tell routing that my default action name is equal to the HTTP Action Verb?

I've looked through this document on MSDN and can't come up with the answer. Considering that I have a route defined like this: config.Routes.MapHttpRoute( name: ...
0
votes
1answer
47 views

serializing form data to a web api

is there a better way of implementing this code: public Payment SendPaymentToSagePay(Payment paymentModel) { var webClient = new WebClient() { BaseAddress = ...
0
votes
1answer
53 views

using ControllerContext.RequestContext in a web api controller

I am try to integrate SagePayMvc.dll into a ASP.NET Web API project which requires ControllerContext.RequestContext to be passed in order to form the Notification Url. Currently I am experiencing ...
0
votes
1answer
65 views

Asp.net Web Api Redirect request

I have an Asp.net Web API project which has several CRUD methods. On top of these methods, i want to add an Authorization service that reads the Authorization header and prevent users of accessing ...
1
vote
2answers
129 views

Asp Web Api async action - 404 error

I've got some api controller with this action: public class ProxyController : ApiController { public async Task<HttpResponseMessage> PostActionAsync(string confirmKey) { return ...

1 2 3 4 5 27
15 30 50 per page