Most voted "asp.net-web-api" questions
ASP.NET Web API is a framework for building HTTP services for clients such as browsers and mobile devices. It is based on Microsoft. NET Framework and ideal choice for Restful services.
Learn more…455 questions
Sort by count of
-
0
votes1
answer53
views404 Not Found. Resource or location?
Sirs, I have a webapi whose end point is used to return an employee’s information. Consider the two scenarios below : In scenario 1 the URL below is invalid, non-existent. Of course the server…
asp.net-web-apiasked 5 years, 3 months ago Adelson Silva 21 -
0
votes0
answers54
viewsDefine Content-type Web API C#
Good morning Guys, here’s the thing, I’m creating a Web API that should receive some parameters among them a binary format image with the content-type "octet-stream". The other parameters are sent…
-
0
votes0
answers169
viewsOnly GET request works, POST, PUT and DELETE this locked
I am implementing the Entityframework in a system that is based on selects, Insert... When I make a request POST or PUT this giving second error. The get method is working normally. .net 4.7.2 By…
-
0
votes0
answers20
viewsWenxamarin - Web API
I’m trying to make the code of the Post Api and I’m not able to save the information, since it comes from a relationship between two tables. It is a sales system, where I have two tables, one that…
-
0
votes2
answers607
viewsError add-Migration . net core 3
I am trying to add the add-Migration in my solution but always happens the following error "Value cannot be null (Parameter 'connectionString')" but my connection string is correct in…
asp.net-mvc postgresql asp.net-core asp.net-web-api asp.net-core-web-apiasked 5 years, 1 month ago Diego Wenndson Souza 3 -
0
votes1
answer92
viewsHow to perform multiple database insertions
I am a beginner and I have a code in which I need to insert multiple products inside a shopping list, however, in the code I made, it is only possible to insert one JSON at a time. [HttpPost]…
-
0
votes1
answer152
viewsJSON Customized for Dataannotations - Asp.Net Core Web Api
Good afternoon! I have a Web API in . Net Core, where I have the following request class for a POST route: public class CreateAgentRequest { [Required] public Agent Agent { get; set; } } With…
-
0
votes2
answers130
viewsHow to call an action as soon as the Web API starts?
I’m studying Web API and I’m having doubts about how to call an Action as soon as I click the Visual Studio play button. I imagine this should be done in the Main method of the Program class, but I…
-
0
votes1
answer101
viewsUpload files to Asp.NET MVC 4 - Web API - Http Put Method
So, I have to do a method in my controller for an API that accepts 2 files via PUT (1 json E1 xml for data processing, not to save the files), and I have to send the request via Fiddler.. My request…
c# asp.net-mvc asp.net asp.net-web-api multiple-file-uploadasked 4 years, 9 months ago helloCodingMyOldfriend 1 -
0
votes1
answer30
viewsWhat kind of data in an Application Service with 3 different tables?
I have an Application Service in ASP.NET Core that will fetch the database data from a table "Employees" that are number, name, departmentname and cityname... the last two fields I mentioned are…
-
0
votes1
answer360
viewsAppsettings.json generating with incorrect settings
Good morning! I am working on an API . Net Core 3.1. This API is divided into 3 environments, DEV, Homologation and Production. I have 4 configuration files, Appsettings.json,…
-
0
votes1
answer190
viewsAccess a Singleton Repository outside the Controller (Dependency Injection)
I have a Repository instance added as Scoped in Startup and to access the instance I do the dependency injection by the Controller constructor, or by Fromservices. However, I need to access…
c# asp.net-mvc asp.net-core asp.net-web-api dependency-injectionasked 4 years, 4 months ago Jd3 Tecnologia 50 -
0
votes2
answers40
viewsHow to do JSON function return Monthly amount of liters fueled in one year period
The function should return this Example: { "January": 500.00, "February": 514.00, ....} My table has the following fields. Km of supply Liters Abastecidos Valor Pago Date of supply I developed an…
-
0
votes0
answers21
viewsSSO using Identity single login for various applications accessing the same database
Hi, hello, introduction: I have been trying to understand, I believe that the functionality of cookies may be the best alternative to help my need to log into only one web page and redirect to…
asp.net-core asp.net-web-api cookies asp.net-identity thatasked 4 years, 1 month ago Guilherme Ferreira 1 -
0
votes2
answers92
viewsProblems when passing an object in an Httppost request
I’m creating a Dotnet API, and when I tried to test a Post request with Postman the only data coming to my controller’s method is Name and CPF. Below is an image with the request I’m making in…
-
0
votes0
answers24
viewsUnilateral Relationship EF sql Server
I have a problem in the relationship of entities with the Entity Framework Core v3.1.5, Code First I have entity Cliente relating to the entity DadosProfissional and my problem is, when I register a…
sql-server asp.net-core asp.net-web-api entity-framework-coreasked 3 years, 11 months ago Ricardo Soares 29 -
0
votes1
answer44
viewsHow to return a JSON in ASP.NET API that has another JSON inside?
I don’t know if my question expresses well, but the kind of feedback I need is something like this: [ { "Id": 0, "Name": "string", "Image": "string", "Why": "string", "What": "string",…
-
0
votes1
answer41
viewsI can’t handle exceptions in the Controller on an ASP.NET API
In the code below I am trying to change the status of the request when I could not find the Project ID. // GET api/values/5 [HttpGet("{id}")] public Project Get(int id) { try { var project =…
-
0
votes1
answer31
viewsI cannot return ID when entering data via ASP NET Controller POST
I have the code below, and I need the ID returned as soon as I insert the object. If there is already a registered project, it does not do the insertion, but I need to return some data as empty or…
-
0
votes0
answers19
viewsMultiple requests for an API result in 500 Internal Server error
I have an API that makes two requests on Microsoft services (POST and GET) that receive a code and bring some information about employees. public async Task<string> AdquirirEmail(string…
-
0
votes1
answer27
viewsPOST method in the ASP.NET Controller API is auto-incrementing foreign key even if the value should be empty
I have the following code: public ActionResult Post(Project project) { try { _acess.AddProject(project); } catch(DataException ex) { BadRequest(ex.Message); } return Ok(); } Sent JSON object: {…
-
0
votes1
answer32
viewsPass an array to a webapi controller
I’m having trouble passing an array to a controller via Axios. Example of the WEBAPI Controller code: [HttpGet] [ActionName("openshape")] [Route("api/shape/openshape")] public…
-
0
votes1
answer19
viewsAsp.Net api with xml Iscancellationrequested
I have an api that accepts the post request with json and xml for Pedidocompra, for cases where I receive the xml is occurring an anomalous request cancellation, that is, some enter the api and…
-
0
votes0
answers45
viewsSwagger returns error when climbing the API
I’m catching this mistake: Fetch errorundefined https://localhost:44358/Swagger/v2/Swagger.json When I only had one controller, Swagger would go up normally and I could do my tests and so on. Now,…
-
0
votes0
answers26
viewsWebhooks association
Hello, I have a code that integrates Jira and Discord from a webhook. It works correctly, however I would like to add more than one webhook. But I’m not quite sure how to do this. using System;…
-
0
votes0
answers18
viewsUsing a domain class as input model is bad?
my first question here. Well my question is more related to code design. Let’s say you developed a c# Rest API using . net core and you have in your domain a class called Pessoa and you have a…
-
0
votes1
answer12
viewsProblems implementing JWT authentication with NET Core 5
Hello, I’m having trouble implementing JWT in my API, I researched and looked at several tutorials on the subject and noticed that they use Identity, but I use Dapper to be able to check if the user…
-
0
votes0
answers19
viewsIs the Web API more efficient than Web Methods to access data in a C#application?
Today on the C# Dotnet you can access a C# function on your ASPX page by javascript, without needing Jquery. As long as the function is Static and dependent on system.web.service.webmethod on an…
-
-1
votes1
answer331
viewsError calling REST service
Yesterday good, my service worked, except for fields float, but commenting on this part until I have a solution, I was testing and running, in reality an Android APP to consume this service. Today I…
-
-1
votes2
answers778
viewsPost Sends data but webapi captures null
I’m taking this header from the Fiddler. POST http://localhost:8887/api/values HTTP/1.1 Host: localhost:8887 Proxy-Connection: keep-alive Content-Length: 352 Accept: */* Origin:…
-
-1
votes1
answer809
viewsASP.NET Core - Search for GET requests
I am using ASP.NET Core 2.1 Web API and need to perform searches by certain type of field, IE, on my front I can choose the field I want to do the research and my back-end need to pick this value.…
-
-1
votes1
answer222
viewsError calling a method in ASP.NET Web API and Ninject
I am getting error while trying to call a method from a Web API. Declaration of the method in ApiController public class AcessoController : ApiController { [HttpGet] public UsuarioModel…
-
-1
votes1
answer122
viewsHow to make an error handling for search not found in ASP.NET API?
The return outside the Try-catch block returns me an empty array, but what should I put there to return some error message in the API request status? Removing Ienumerable and switching to an…
-
-1
votes2
answers198
viewsHow to walk a C#class?
I have the DeserializeObject that fills in an order class and items, on the items I need to go through this class to record the data, the way I’m doing is zeroing the records, how I could read the…
-
-1
votes1
answer113
viewsHow to view in a data listview via web api?
I am having difficulties to accomplish this task, need to fetch data that are stored via mysql on a website and display them on my app being developed on Xamarin Forms, for this I need to make a…
-
-1
votes1
answer850
viewsPick up json from Postman and play on an object
Have POST and use the Postman to test. Mount the url and body in Postman. Now, when I test on my object on mine Controller comes NULL, and of course it’s because I didn’t do it correctly. What do I…
-
-1
votes1
answer129
viewsKendo ui Chart with multiple graphics - Assincrono
I have a screen that can have 1 or more graphics, so I’m using Kendo Ui Chart, however today this screen is synchronous, however I would like to switch to Asynchronous to get faster. I created the…
-
-1
votes1
answer48
viewsEdit screen does not load data on screen
When entering edit mode, the Dits should be filled in and only the city dropdownlist comes. See cshtml below. @model TreinamentoCrud.FuncViewModel.FuncionarioViewModel @{ ViewBag.Title = "EditVM"; }…
-
-1
votes2
answers114
viewsdoubt to consume api
I have the following service: [HttpGet] [Route("save")] public async Task<dynamic> save(VendaModel[] venda, string CnpjEstab) { dynamic retorno = null; VendaModel ultima = new VendaModel();…
-
-1
votes1
answer3469
viewsASP . net core (HTTP error 500.19 - Internal Server Error)
I have a web api, which when running on Iss presents error 500.19 in the browser, I am very new in the subject, I did some research this error may be on web.cofing. If anyone can help me, thank you!…
asp.net-mvc-5 asp.net-core asp.net-web-api iis visual-studio-2017asked 5 years, 5 months ago Matheus Vinicius 23 -
-1
votes1
answer230
viewshow to decrease the response time of a Web API?
I’m a beginner in C# and I’m developing a CRUD using Angular and Web Api (Entity Framework Core), but the response time to list my Serverscontroller data in my table is very high. What happens…
-
-1
votes1
answer166
viewsProblem raising API and making request via Postman
I’m creating an API project in dotnet core and I’m not being able to perform requests via postaman on it. Urls of attempts: "http://localhost:5050 e http://0.0.0.0:5050" "https://localhost:5001 e…
-
-1
votes1
answer44
viewsI cannot authorize my HTTP methods with the token generated by Bearer and Jwt
Good night, I am implementing authentication and authorization in my Web API in Asp.net core 5.0. Yesterday, I had success with some authorizations. However, when I went to try to finish…
-
-2
votes1
answer396
viewsTelegram bot without webhook
I’m using the Telegram api Telegram bot to create a bot. I can already send messages, files, etc. I am creating commands for the "/setcommand" bot and I want this command to do something, a routine,…
asp.net-web-apiasked 8 years, 1 month ago Daniel Vieira Junior 95 -
-2
votes1
answer55
viewsTurn float or double into date within a lambda
In BD you have a field with a float value, which is actually the number of days from the date 28/12/1800, that the Clarion programming language stores. Well, I have a service REST that is consumed…
-
-2
votes2
answers231
viewsRouting problems using Asp.net core
When trying to route a core 2.0 application, I can’t get to the controller. public class GetClientController : Controller { LoadClient loadClient = new LoadClient(); [HttpGet] public…
-
-2
votes1
answer42
viewsDelete api not working, do not delete. Stored Procedure in the database is working
This is the API public class DeleteCidade { BancoContext banco = new BancoContext(); public void deleteCidade(int id) { banco.Database.SqlQuery<Cidade>("exec sp_del_cidade", new…
-
-2
votes1
answer53
viewsChanging the select in SP gives error
That is the mistake: System.Data.Entity.Core.EntityCommandExecutionException: 'The data reader is incompatible with the specified 'TreinamentoCrudApi.Context.Cidade'. A member of the type, 'id',…
-
-2
votes1
answer147
viewsDate formats API + C#
I developed the system in layers, and I have 2 layers, where layer number 1 is my API and number 2 is where I keep my classes. In one of the classes I have a field of type DateTime. I created a…
-
-2
votes1
answer43
viewsQuery that searches quantity of items from a column in a table with the same name
Hello, I’m trying to find the amount of records with the same name, from a certain column in my Lead table in the database in a period (month). Follow my class, I want to search only from the field…