Category "asp.net-web-api"

How to implement a client_credentials grant type in an angular http request?

I've created an OAUTH2 authorization server which uses client credentials for authentication and is responsible for the issuing of JWT tokens. When I place my

ASP.Net Core Web API ModelState unvalidated when Dictionary used in FromQuery

I have a GET endpoint which accepts a few parameters and a Dictionary in the Query. public IActionResult Get([FromQuery] RequiredFields required, [FromQuery] D

C# WEB API CORS does not work

Fighting with CORS. I have a site that is making a simple XmlHttpRequest to a WEB API I built in C#. var xhr = new XMLHttpRequest(); xhr.open("GET","h

Create WSDL for an ASP.Net Core ApiController

I am creating a service using ASP.Net Core. The service is based on the ApiController. [ApiController] public class XmlALaCarteServiceController : ControllerBa

IFormFile always return null in asp.net core 2.1

Here's how I upload file my Api action : [HttpPost] public async Task<BaseListResponse<MediaStorageModel>> MediaBrand(IFormFile file, int brandId)

FromBody string parameter is giving null

This is probably something very basic, but I am having trouble figuring out where I am going wrong. I am trying to grab a string from the body of a POST, but

Sending Email Using SMTP Bluehost Server

I use ASP.NET WEB API and I want to send an email from my application from an email created by https://www.bluehost.com/ Here is the configuration in the web

.Net Framework 4.6.1 - Web API - HttpResponseMessage.Content is empty for StringContent

Content being returned by HttpMessageResponse is blank/empty after being explicitly set I have created a WebApi with the latest .net Framework 4.6.1 and am try

net::ERR_CONNECTION_REFUSED ionic

I'm developing an application using ionic , I could retrieve data from my webApi server and display them on the navigator with ionic serve but when I try to exe

How to pass NTLM credentials using angular http post call? [duplicate]

I am working on localhost where angular and web api using 2 different ports that's causing issue now. I am trying to call web api c# from angu

MissingMemberHandling.Error force exception when deserializing the HTTP body

I am creating a restful web-service using .net and Newtonsoft for serialization/deserialization. The aim is to force exceptions (preferably HTTP 400) when a re

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