Category "asp.net-web-api"

How to download file on browser from Dotnet core endpoint

I have a react front-end and the dotnet core web API project on the back-end. I have an endpoint on which a client can request a file using fileId from my react

System.ObjectDisposedException: 'Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope

I have an async controller and I am trying to call two different Async functions from it. like this public async void Approvefiles(string[] data) {

how to read local excel file using webapi?

public class ExcelParserController : ApiController { [HttpGet] public IEnumerable<string> Get(string templatePath) { ExcelParser excel

WEB API Google Authentication access denied

I am trying to use google authentication API to have a google log-in on my web API project. Created the OAuth and I enabled the Google+ API added the Clie

Setting headers for Odata client

I've been trying to set authorization header value for Odata client. After I instantiate the client, I do it like this: container.BuildingRequest += (sender, e

Prevent IDM from downloading automatically in web api

I have a web api method that returns an HttpResponseMessage containing a PDF file. The method looks something like this: HttpResponseMessage response = Request

Publishing and hosting Web API developed in .net core through IIS

I have WEB API developed in .net core (VS 2017). I need to deploy this api in IIS. This is the procedure I have followed. Open VS 2017, open the project -> r

ASP.NET Core validate Firebase Auth emulator JWT

I'm trying to validate a JWT issued by the Firebase Auth emulator. The following code snippet is working fine for production apps, but I can't figure out how to

How can I access web.config values from within a class attribute?

I have the following EnableCors attribute on a WebApi controller class: [EnableCors(origins:"http://localhost:57280", headers: "*", methods: "*")] public class

How to set HttpResponse to HttpResponseMessage in Web API

I have a asp.net web API application hosted using OWIN. The web API application uses an external library which depends on System.Web and writes its response on

Changing the parameter name Web Api model binding

I'm using Web API model binding to parse query parameters from a URL. For example, here is a model class: public class QueryParameters { [Required] pub

asp.net web api: action filter attribute is thread-safe by default?

Can some one confirm me that asp.net web api action filters are singleton/instance based by default? In asp.net core, I observed that it has one instance by def

ASP.NET Web API and OpenID Connect: how to get Access Token from Authorization Code

I try to get OpenID Connect running... A user of my Web API managed to get an Authorization Code of a OpenID Connect Provider. How am I supposed to pass this co

Passing UTC DateTime to Web API HttpGet Method results in local time

I'm trying to pass a UTC date as a query string parameter to a Web API method. The URL looks like /api/order?endDate=2014-04-01T00:00:00Z&zoneId=4 The s

How do I remove an existing claim from a ClaimsPrincipal?

I am making a developer tool for impersonating Roles for an intranet site to allow developers to quickly act as any Role as needed. Roles defined are Developer

Azure AD API request 401 Unauthorized

I have a standard Web API running on an Azure website with Azure AD authentication enabled, when browsing to the API in a browser I am able to login via the bro

Order of execution with multiple filters in web api

I am using latest web api. I do annotate some controllers with 3 different filter attributes. 1 [Authorize] 2 [RessourceOwnerAttribute derived from Authorizat

How do I get ASPNET WebAPI working with Microsoft.Owin.Host.HttpListener on an Azure worker role using an IoC container?

When I have the following packages installed in an Azure worker role: <package id="Microsoft.AspNet.WebApi.Client" version="5.1.0" targetFramework="net451"

Swagger UI Web Api documentation Present enums as strings?

Is there a way to display all enums as their string value in swagger instead of their int value? I want to be able to submit POST actions and put enums accord

notification does not implement $INotification C#

I have a multi-tenancy project using mediator and CQRS, for some reason my CRUD from order request are returning this error, I already try refactor my handler s