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
-
1
votes0
answers38
viewsProblem accessing the Controller
Apicontroller [Produces("application/json")] [Route("api/[controller]")] public class ClienteController : Controller { private IClienteRepository _ClienteRepository; public…
-
1
votes1
answer56
viewsC# - EF Core doubts to create relational model
I am starting in Asp Net Core and have the following question: I own a model Curso and a model Unidade, a course has several units and that unit may belong to more than one course. I made the…
-
1
votes2
answers193
viewsTimeout Sql Server in a request via Web Api
Running the query gives a Timeout Sql Server error: Connection Method: public SqlDataReader GetDataReader(string comando) { SqlConnection conn = criaConexao(); // Cria Comando SqlCommand cmd = new…
-
1
votes1
answer123
viewsHow to ensure that the generated JSON does not return error to the Customer?
I created a Web API that returns a JSON and who is having a problem similar to the question JSONP: status code 200 OK and still returns $.Ajax(... error:Function()...). Client consumes the API with…
-
1
votes1
answer1085
viewsProblem calling api in React JS
I created a webapi in ASP.NET Core, and I need to consume it using React, the web api works normally, if I use Curl or Postman among others, it works normally. The problem starts when I use React,…
-
1
votes1
answer40
viewsPost with api aws
I’m trying to make a Post for a service of AWS. I have never worked with AWS and I am studying some links and uninterruptedly I am doing a connection test using this code: private static async void…
-
1
votes1
answer141
viewsReturn json from query Inner Join ASP.NET WEB app C#
Good afternoon, you guys. I’m trying to return the result of a query with INNER JOIN in a C# REST API but I’m not getting it,I can’t use frameworks, it has to be at the base of the code, I’ve…
-
1
votes1
answer172
viewsConsume the Security of an API for MVC Web Application
I have an API to log (Aspnet Identity) into the WEB MVC application. Access to WEB MVC application(Login Screen). I call the API by passing email and password, which was informed in the WEB MVC…
-
1
votes1
answer52
viewsAdd message in Oauth reply
I created a web api with token validation that works correctly, my problem is: I would like to put a message after the mandatory information, I leave attached an example image(I would like to add…
-
1
votes1
answer123
viewsJsonproperty(Propertyname) does not recognize and assign values to the object
I’m creating a API, POST method, where the payload consists of 3 classes with the following structure: //Classe principal do payload public class Representante { [JsonProperty(PropertyName =…
-
1
votes3
answers652
viewsWeb API does not return JSON
made a web api c# where by default returns xml, tried from various internet methods turn this return to json but when I make a request keeps coming in xml, someone could help? method giving the…
-
1
votes0
answers569
viewsPost with JSON - Httpclient C#
I need to do a Postasync in my web-api, passing a JSON as parameter. I tried it as follows, but I have not had success so far... Regardless of the structure of this JSON, I get a Bad Request when…
-
1
votes2
answers331
viewsWhat should I return in an Httppost and Httpput in an API?
I am doing an API in . NET Core and I have a question in what I should return in the methods Httppost and Httput, as below: // POST: api/Product [HttpPost] public async Task<IActionResult>…
-
1
votes0
answers40
viewsSwagger does not display methods containing array parameters
I created a WebApiwith basic methods intended to use the Swagger. I noticed that methods that have simple parameters like the one illustrated in the code below are displayed by Swagger but methods…
-
1
votes1
answer252
viewsError deserializing Json . NET CORE 5 - Jsonexception: A possible Object Cycle was Detected
I basically created an API project on. NET 5. My idea is to consume their API (Take repository information), and then make some information available in my API. The request is successful but there…
-
0
votes1
answer358
viewsMVC Webapi Ajax error on type-approval server only
I have a mvc page that calls a method in the webapi (another project within the solution), it turns out that in the localhost everything works normally, when it will homologation, when calling the…
-
0
votes2
answers3488
viewsCustomer Facilities, WCF or Web API?
I need to create a web service for data insertion in a database that requires validation to ensure data integrity. I have as a requirement, to facilitate the use of my "clients". Therefore, I must…
-
0
votes1
answer110
viewsPattern design for Webapi project
I need to create a project with Webapi to consume some procedures of a remote SQL database, for example: sp_retornaProdutos(1) turning that into /produtos/1 and returning the result in JSON. I…
-
0
votes1
answer210
viewsError returning data using Fluent Nhibernate (Many to Many)
I have a relationship of many to many (M:M) using Fluent Nhibernate: Class/Map - Unit: public class Unidade { public virtual int Id { get; set; } public virtual string Descricao { get; set; } public…
-
0
votes1
answer984
viewsUpload C# API file
I have a C#MVC application, which is a web system. And I have a C# API that receives calls from the Site. I need to send a file from the Site to the API, I did the code as follows: Sending Site Code…
-
0
votes1
answer208
viewsProblem rescuing References from a query in Nhibernate Hasmany
I’m using Nhibernate with Webapi have 2 entities Profile & Personal Personal Login may have N Profile and Profile 1 Person Login. However, when I go to the Personal webservicelogin the Profile…
c# asp.net-mvc asp.net-web-api nhibernate fluent-nhibernateasked 9 years, 11 months ago Daniel Machado 1 -
0
votes1
answer52
viewsReference error
Hello, I copied a Solution from one folder to another and started giving some reference errors, is an Asp.Net application that has a web API project. In the original folder the application is…
-
0
votes1
answer251
viewsHandling JSON with Asp.net Web API
Hello, I’m setting up an educational application where I have a course schedule. In this project I am using a jquery calendar, and this one uses a json to assemble the dates that has scheduled…
-
0
votes1
answer169
viewsHow do I use the web api for controllers and MVC for view(Front-end)?
hello, my problem is this, I’m doing an internship test and the guy asked to do an Asp.net project with mvc only for views, and web api only for controllers and another layer for the bank only that…
-
0
votes0
answers104
viewsEnable CORS in the request header
someone knows if they can enable CORS in the ajax request header without having to do anything on the API server, similar to what POSTMAN does. With POSTMAN as you test the API and it works right…
-
0
votes0
answers296
viewsimmaculate how to extract only numbers
I have this code ONDOWNLOAD FOLDER=D:\ FILE=media.jpg WAIT=YES TAG POS=1 TYPE=IMG ATTR=ID:adcopy-puzzle-image-image CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT TAB OPEN TAB T=2 URL…
asp.net-web-apiasked 9 years, 7 months ago Antonio Ferreira 1 -
0
votes2
answers71
viewsPrefix (stackify) + Web Api + MVC + EF 5 is not monitoring querys
Good Afternoon. Guys, I’m not being able to use Prefix (stackify) + Web Api + MVC 4 + EF 5, because it is not being able to monitor the querys performed and perform the information return. In the…
-
0
votes2
answers738
viewsPaging with Angularjs and Webapi
I need to make a pagination using AngularJS. Well, I made a controller for a popular one Table HTML. This is now working. My next step is to page this table. I picked up an example on the internet,…
-
0
votes1
answer237
viewsWhat to use to connect to the internal-only Web Api
I’m a beginner and I built a mobile application in C# that connects to a Web Api. However, the Web Api will be on a server that has only internal access, which would theoretically protect the BD.…
-
0
votes1
answer946
viewsReading headers in Webapi
I have a code that posts to a url and adds some parameters to the request header HttpWebRequest req = WebRequest.Create(new Uri(url)) as HttpWebRequest; req.Method = "POST"; req.ContentType =…
-
0
votes1
answer51
viewsHow to create MVC 4 web.api project instead of MVC 5
I have a problem when it comes to creating my project in VS 2015, whenever I create the web.api application it creates with the version of MVC 5, but I need it to be MVC 4 because of the hosting.…
-
0
votes1
answer77
viewsExtract information from requests header in Fiddler
I need to extract information from the header of a request in the app FIDDLER to make a comparison of a context variable that is sent in the header and set routes based on that variable. In this…
-
0
votes0
answers223
viewsMethod POST Web API returns 'NULL'?
I’m developing a Web Api with ASP with VB.NET to receive parameters JSON and created a method post with the following code. Public Function PostValue(<FromBody()> ByVal value As String) As…
-
0
votes1
answer172
viewsIs it right to create a viewmodel for registration (post) and another for consultation (get) of a User entity?
I am taking my first steps in Web API. I created a Viewmodel of the User entity, I will use it for user registration. Now, when returning the data, it has fields, like the password, which I don’t…
-
0
votes1
answer2589
viewsHow to test the Restful API?
Hello, I am interning and the boy created an AP and ordered me to do the post http methods,delete and etc.. I wonder if it’s correct what I did and his code, and how I do to test it. config.js…
-
0
votes1
answer115
viewsAzure - Error 401
I am trying to make a post to insert a record in a Webapi hosted on Azure. https://acelerasp.scm.azurewebsites.net/api/Ocorrencia/InserirOcorrencia I am using POSTMAN to perform the tests, passing…
-
0
votes1
answer162
viewsWCF + Web API - How to integrate?
I am developing a web api and need to integrate with a third party service that is a WCF. I have the definition of WSDL, integrated in my Solution as a service Ference, but is pointing to a physical…
-
0
votes1
answer103
viewsDifference between Webapi and SPA
I know that SPA is nothing more than a WebApi specific, but the question is: How do I differentiate one from the other, ie what the purpose of each in the Development world. Why would I develop a…
-
0
votes0
answers488
viewsConsuming WEB API ASP.NET MVC 4 [ERROR]
I have a problem... I put my web api in Ocaweb... But if I use the link in the project, it does not work and returns me "Statuscode: 500, Reasonphrase: 'Internal Server Error', Version: 1.1,…
-
0
votes1
answer129
viewsCustomized Webapi Response
Hello, I have a Webapi service and would like to get an answer specifically with a Date, but at the time I call this service and get the return of my Postasync what I see is just an httpResult…
-
0
votes1
answer1431
viewsHOW TO MAKE A Getasync in an ASP.NET API by passing an object as a parameter?
I would like to know how to send an object as a parameter to an API made in ASP.NET and return data by the same way? I understand that the simple method of a Get is: HttpClient cliente = new…
-
0
votes1
answer986
viewsConfigure HTTPS in Webapi
I made a Web Service using Webapi MVC5, with Visual Studio 2017. It’s working, but how do I use HTTPS instead of HTTP? Does anyone have any material for me to research? I found some things but with…
-
0
votes2
answers156
viewsI cannot capture the post by webapi c#
good morning. I’ve been trying for a few days trying to capture a POST made in Javascript by webapi c# and the most I can is the webapi telling me that the expected parameter is NULL. var…
-
0
votes1
answer103
viewsIntegration testing in complex API scenarios
Good afternoon, For a simple scenario I delete all records from the database tables before performing each integration test. My question is the following how to prepare the test database for complex…
asp.net-web-apiasked 7 years, 5 months ago Wandelson Bezer 21 -
0
votes3
answers1019
viewsReturn Notfound() Web Api c#
I need that if the return of Get of controller below for null he returns a specific message, where he has return NotFound(), but it’s not working as expected and I tried to implement separately but…
-
0
votes1
answer132
viewsDoubt with Webapi data insertion
I’m using the Postman: Error: "Undefined object reference for an object instance." I have the Controller Code: //http://localhost:1608/api/ApiGuiaCidade/cadastrar/cliente //"Referência de objeto não…
-
0
votes1
answer516
viewsFirebird with restfull service and web api in C#
Hello, within a project I came across the following situation, I need to replicate information from a db Firebird Desktop to a db SQL Server Web, as both architectures do not talk to each other, the…
-
0
votes2
answers219
viewsService to pick up a change in the bank
Here’s what I need. As I do for a service to auto startar whenever the flag of the bank changes from 0 leg 1. I have a field in a table in the BD(Sql Server), that every time the seller request a…
-
0
votes1
answer155
viewsA timer for a service read a table in the comic book
I need to get a service to read a table in the comic book every 5 or 10 seconds. I don’t see any other way to do that. When in this table a certain Flag is changed, then the service pushes a message…
-
0
votes1
answer44
viewsWindows service sharing information with a Rest
Is it possible for a Windows Service to exchange information with a Web Service Rest? If so, is that good practice or not? Why the question? This is what I need to do. When a flag in the bank is…