314 questions with ASP.NET API tags

Sort by: Updated
1 answer

How to get data directly from request.form.file[0] instead of copying it to server ?

I work on c# 7 I face issue I can't get data from file Request.form.file[0] directly it must copying to server to get data from it so can i get data from variable DisplayFileName instead of get data from input path after copying to server below is my…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,346 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,582 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-09-10T13:13:08.973+00:00
ahmed salah 3,216 Reputation points
commented 2021-09-13T05:41:07.613+00:00
Zhi Lv - MSFT 32,076 Reputation points Microsoft Vendor
1 answer

Using Gmail And Web Api To Send Email Failing

I am currently busy with a Web Api allication that sends emails using the credentials from my gmail account. I have the following in my webconfig file <mailSettings> <smtp from = "mygmailemailaddress" > <network…

ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-09-06T11:32:23.097+00:00
37349445 11 Reputation points
answered 2021-09-07T02:52:43.777+00:00
Lan Huang-MSFT 28,821 Reputation points Microsoft Vendor
6 answers

C# - Making sync function to async

Hi, I am just wondering if below code changes (New Code) make any difference in performance with respective to calling cosmos from a web api Old Code: public string GetDocs() { return JsonConvert.SerializeObject(CreateDocumentQuery().ToList());…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,582 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-02-17T19:11:01.157+00:00
sravan kumar 121 Reputation points
answered 2021-09-03T15:46:05.227+00:00
Bruce (SqlWork.com) 60,386 Reputation points
1 answer

Web Api Still Getting Cors Errors After Installing Microsoft.AspNet.Cors And Enabling Cors On Controller

I am buildind a Web Api app locally and I am calling the methods using simple jQuery ajax method calls. As per the title I have installed the Microsoft.AspNet.Cors package via nuget and enabled cors in my WebApiConfig.cs and on my controller like this …

ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-09-01T06:08:40.733+00:00
37349445 11 Reputation points
answered 2021-09-01T19:05:37.59+00:00
Don Slattery 1 Reputation point
0 answers

c# Asp Web API: HttpException: Maximum request length exceeded.

This might be a common question, but my situation is not so common. I an sending a serialized image into an Asp.net Web API method and am getting this error: System.Web.HttpException: Maximum request length exceeded. at…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,582 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-08-26T08:27:19.473+00:00
moondaddy 911 Reputation points
commented 2021-08-27T05:48:24.203+00:00
Yijing Sun-MSFT 7,071 Reputation points
2 answers

Conversion from .NET framework 4.6 to 4.8

I have converted my web api framework target from 4.6.2 --> 4.8, this is the error I get after I change target framework and reinstalling nuget packages:- The type initializer for 'System.Web.Http.GlobalConfiguration' threw an exception.. error…

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,136 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-07-27T04:37:09.453+00:00
Dutta, Pijush 1 Reputation point
answered 2021-08-22T16:43:51.133+00:00
Ravi Shankar Kakarla 161 Reputation points
1 answer

Request help on connecting webapi from azure relay

Hi Team, We need some help on the below enhancement. We have an existing asp.net webapi hosted in iis. We are using mysql as a backend. We need to use azure relay-mostly hybrid connection, to call the webapi. Note: we don't want…

ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-07-21T16:59:52.843+00:00
Ravi, Sriram (Cognizant) 1 Reputation point
answered 2021-07-22T14:48:58.767+00:00
Bruce (SqlWork.com) 60,386 Reputation points
1 answer

ASP.NET Web API: Mock authorization, headers in Unit Test

Hi All, I have to mock the authorization and headers while calling controller action in the Unit test method. ValueController.cs ( ASP.Net Web Api(.Net Framework 4.6.1) Public async Task<HttpResponseMessage> ValueProcessMessageAsync() { …

ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-07-20T06:40:57.303+00:00
Jayakumar vinayagam 1 Reputation point
answered 2021-07-21T15:14:44.933+00:00
Bruce (SqlWork.com) 60,386 Reputation points
3 answers

Select only few columns from a table to map with Odata Select query on C# Web API

We have a table in the database which has multiple columns. We only want a query which will return only requested columns. These requested columns will from Odata Select Query requested using C# Web API. For Example, I have an EmployeeTable which has…

ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2020-12-25T10:42:06.213+00:00
roshni gandhi 1 Reputation point
answered 2021-07-17T17:39:12.037+00:00
Gokhan Guleser 1 Reputation point
1 answer

Passing an Interface as a parameter to Web API method

Hi All, I would like to know how can I pass an interface as a parameter to a Web API method. Here's my interface: public interface IPerson { string Gender { get; set; } decimal Weight { get; set; } } I am sending this information…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,346 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-07-17T11:34:54.403+00:00
37349445 11 Reputation points
answered 2021-07-17T17:12:23.78+00:00
Bruce (SqlWork.com) 60,386 Reputation points
1 answer

Web api hosting

Hello everyone, I am new to web api. I have this simple question about web api host. So here is how a client application consume the web api: public class StudentController : Controller { // GET: Student public ActionResult Index() { …

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,582 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-06-30T22:44:09.007+00:00
bigFan 21 Reputation points
commented 2021-07-01T16:23:50.997+00:00
Bruce (SqlWork.com) 60,386 Reputation points
2 answers One of the answers was accepted by the question author.

How to serialize objects into XML C#

I have written a simple webAPI program which returns JSON by default when running , I want the values in XML format so I tried below code it always returns string for me, have also tried multiple solution from this stackoverflow post but all returns…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,582 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-06-29T20:18:16.107+00:00
Kumar, Sumant 96 Reputation points
commented 2021-06-30T19:46:52.803+00:00
Oliver Rivett-Carnac 6 Reputation points
1 answer

Response code 400 in Asp.net core 3.1 version

I am getting 400 response code in Asp.net core web api on POST Save method Controller/Save ,i just recently upgraded .net core web api version to 3.1 [HttpPost] [ContentValidation("Shell.xsd")] [Authorize(Policy =…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,346 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-06-22T14:47:28.147+00:00
Ketan Patil 21 Reputation points
commented 2021-06-25T02:56:21.223+00:00
Brando Zhang-MSFT 3,361 Reputation points Microsoft Vendor
0 answers

Azure Identity Platform - Authenticate logged in user against Custom WebAPI Endpoint using ReactJS Client

Hi. We have a dotnet Aspnet WebAPI based API using .Net Framework 4.7.2 which we access using a ReactJs client Application. We want to authenticate users logged in as an Azure AD user against our API. Our question is as follows: How do we set up our…

ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,370 questions
asked 2021-04-21T10:16:14.6+00:00
Anonymous
commented 2021-06-01T15:41:34.363+00:00
Anonymous
0 answers

CreatedAtAction doesn't work

I need to get a URL with CreatedAtAction but get a null. My searches did not yield any results. **My controller** namespace GeoService.Controllers { [Route("api/continent/{continentId}/country/{countryId}/City")] …

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,582 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-05-12T21:06:05.167+00:00
Michel De Graeve 1 Reputation point
commented 2021-05-14T09:25:26.413+00:00
Chao Deng-MSFT 796 Reputation points
1 answer

c# HttpClient 400 Bad Request when using https

I'm trying to get a web request working using HttpClient. It works when using http, but does not work with https. The URL I'm testing with works in a browser with both http and https, however, when using the code below it works only with http. Do I…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,582 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-05-06T20:53:10.223+00:00
moondaddy 911 Reputation points
commented 2021-05-13T07:18:02.6+00:00
Chao Deng-MSFT 796 Reputation points
1 answer

Cannot edit a web application

Hi I have asp.net web application, I try to edit the code but the content of the site does not change, I tried to convert the web application to a web site but another error appears instead of displaying GDI+ graphics showing a black screen and one…

Internet Information Services
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,397 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-04-08T02:42:44.647+00:00
Yusuf 731 Reputation points
answered 2021-04-29T17:05:22.017+00:00
Ken Kam Hung, Lin 91 Reputation points
1 answer One of the answers was accepted by the question author.

WebAPI Get autogenerated ID of a just created (posted) record

Good afternoon, I have a web API running just fine and a Xamarin forms app on top of it. There I want to create 1:N relation which is fine in the model but I have the following problem: (I don't want to post all the code here so I bring it down to…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,322 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-04-09T12:13:21.32+00:00
Ricardo Enrico Jahn 116 Reputation points
commented 2021-04-16T14:48:04.073+00:00
Ricardo Enrico Jahn 116 Reputation points
1 answer

Caching Token in SOAP-based Web Service

I developed a SOAP-based web service for internal consumption. It takes a SOAP-based web request and converts it to a JSON-based external, third-party RESTful web API request. It then takes the JSON-based external, third-party RESTful web API response…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,575 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,397 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,582 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-02-25T05:05:00.987+00:00
Julio Bello 221 Reputation points
answered 2021-03-26T14:29:10.253+00:00
Pranam K 6 Reputation points
1 answer

how to create api to get orders from Shopify and post to my database

I want to build an api , where I should be able to get list of new orders from shopify each time an order is created in shopify and post that order details into my database. I have a rough idea on api, but not sure how to start to work on it. Can…

ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
314 questions
asked 2021-03-24T03:55:28.997+00:00
durga valliammai 21 Reputation points
answered 2021-03-25T03:01:57.473+00:00
Yihui Sun-MSFT 801 Reputation points