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
answer58
viewsHow do I mount a List or Ienumerable array in the Controller and move to View?
Good evening! I made a request to my webapi to search for data to use=it in a DropDownlist @Html.DropDownList("Id","Descricao"). In My controller, I can pull Webapi results in collection, I treated…
-
0
votes4
answers8648
viewsRemove space and break string lines
I’m making a Webapi that generates an XML, this XML is read several times a day, so in the first run it serializes all my XML and saves it to disk, and during 24h it reads from disk instead of…
-
0
votes1
answer204
viewsApplication . NET C# Nodejs express style
But for a few features I would like my project to respond to some simple HTTP Rest requests. As the project will handle COM+ and more, I will do it in C#. The point is, I don’t want to have to deal…
-
0
votes0
answers275
viewsinserting data into web api
I have a SPA application and it consumes a REST API made in ASP.NET Webapi. When trying to accomplish a Insert in the API, the following error is returned: Response for preflight has invalid HTTP…
-
0
votes1
answer98
viewsOauth 2.0 stream for multiple API authentication using an authentication server
When logging in through my front-end layer, a request is sent to my authentication server which in turn returns a Bearer Token that may be saved to a cookie, for example. No doubt about it! My…
-
0
votes2
answers580
viewsSend Angularjs object to C#API POST
I am not able to save the data registered in a form in the SQL Server database. The structure is as follows: The class: public partial class EMPRESAS_PARTICIPANTES { public int ID { get; set; }…
-
0
votes1
answer651
viewsFilter a NULL type in lambda Expression or Line
Hello, my entity To has a long type attribute that can be NULL making relationship with the entity B, by making a filter with a Lambda expression with this attribute to bring all records that are…
c# asp.net-mvc linq asp.net-web-api lambda-expressionsasked 6 years, 7 months ago Thiago Ubiratan 353 -
0
votes1
answer47
viewsAPI problem after deploying
My api is not working after deploy to the server, it is returning: 404 - File or directory not found. The Resource you are Looking for Might have been Removed, had its name changed, or is…
-
0
votes2
answers737
viewsAngular Controller does not render on my Index
I can’t render a script on my _Layout page. I put in _Layout, together with the Bundles declarations and Chrome debug, in the Network Tab comes with 304 status. I put it at the top of the…
-
0
votes1
answer143
viewsRest Apis for e-commerce
I’m trying to build an e-commerce with a friend and we’re thinking about putting together a Rest api to access the bunch of data and create a website and an app to consume it. Since this is an…
-
0
votes1
answer249
viewsError while trying to create a Controller or Apicontroller
I created an empty Asp.Net Core 2.0 project (no scaffold). DDD model and etc. However when I try to create my controller, whether inherited from Apicontroller or Controller, it gives error:…
-
0
votes3
answers934
viewsI can’t post with Webapi
I’m studying Webapi and using Postman to test it. Doing some tests I realized that nothing comes when I send json using Postman to Webapi. I researched a lot about POST using Webap, but I don’t know…
-
0
votes2
answers112
viewsHow to add a built-in view to an Asp.net core 2.0 controller
I created a view (Razor Page) in an Asp.Net Core 2.0 project. How I build it from scratch and I now need to assign a controller to it. How do I do it?
-
0
votes3
answers282
viewsHow can I do "Inner Join"
Preiso inner join with 2 database tables, let’s say one is called equipment and another indicator type.
-
0
votes2
answers608
viewsSelect columns dynamically with Linq
I have an action in an API that should return a model, but the fields that should be returned are informed in the request. I can do a query with the System.Linq.Dynamic.Core package, but the…
-
0
votes1
answer37
viewsProblems entering webapi(c#) registration with javascript
Good afternoon I’m having trouble inserting registration into a webapi . Net using javascript. The get method is working normally, returning the webapi information within a table. However I am not…
-
0
votes1
answer202
viewsWeb API - Blocking server-specific calls
Well I have the following doubt, after implementing the CORS in an application, I saw that there is still a security breach that is, if an application(Postman, Curl) make direct calls on the server…
-
0
votes1
answer161
viewsIs it possible to have more than one WEB-API under the same domain?
Good afternoon! I am new in the area of development and I am walking in the area of Web applications. I have developed a web-api that is already hosted and running. However, I am developing another…
-
0
votes1
answer163
viewsXamarin - Accessing API that returns JSON
Next, I am VERY new to this API issue. I created my first web application . net Framework 4.5.2. I created it very standard (according to VS 2015), and created a controller for testing…
-
0
votes1
answer355
viewsPOST Web API method returning null
I am making a Web API in C# ASP.NET and in the POST method the value is returning me null. I’m using Postman to play a JSON within value but still returns me null. public string…
-
0
votes0
answers175
viewsDependency injection of two or more classes implementing the same interface
The entire architecture of my system is based on addiction injection, where in my configureServices I configure the injections as follows services Addscoped(); However the need arose for me to have…
-
0
votes1
answer115
viewsHow to Interact from Web Application to Client Machines
I have a web application on ASP.NET MVC which is an intranet project. I would like to add some features to it to make it easier to work with Backup’s. I already have one WIDNOWSFORMS APPLICATION…
-
0
votes1
answer222
viewsHeader in an http.send request
I have a request by stream which is as follows:. Future<Stream<Chamado>> getChamado() async{ final String url = 'www.api' final client = new http.Client(); final streamRest = await…
-
0
votes1
answer213
viewsREST API Consulting another API
I need to make a REST API, which would query data from a cloud API, and return in the app in json format, but even with a lot of research, I didn’t find anything like it, I just wanted to know how I…
-
0
votes0
answers8
viewsChange in ASP.net Deploy project without the original project
I have a project done in Asp.net, and in production has only its Deploy running, and the solution generated by the project’s Visual Studio is corrupted, and I need to change a database configuration…
-
0
votes1
answer118
viewsHow to leave parameter optional, API Asp.net core
I have a question on how to leave optional parameters in the method call in the API. I have the following method: [HttpGet("{aplicativoId}/{moduloId}/{taxaId}/{musicaId}/{produtoId}")]…
-
0
votes2
answers23
viewshow to validate date field for if nothing is passed see the current date
I have an endpoint as follows: [HttpGet] [ProducesResponseType(typeof(IEnumerable<TestsDto>), (int)HttpStatusCode.OK)] public async Task<ActionResult<IEnumerable<TestsDto>>>…
-
0
votes1
answer27
viewsSearch for several API ids. net core
I do not know whether I was clear in the name however I have a doubt, I possess a route as follows: /api/produto/v1/Aplicacao/filter where this endpoint is a GET that passes a word as parameter and…
-
0
votes0
answers14
viewsUnable to generate the model because of the following Exception: 'System.Argumentexception: ', hexadecimal value 0x08, is an invalid character
When trying to generate the template layer of an existing database (Sql server) I get this error. What should I do ?…
-
0
votes1
answer26
viewsError accessing array indices inside a LINQ expression
I am doing a query to search all weather with a certain date, but when executing occurs the following error: An exception of type 'System.NotSupportedException' occurred in…
-
0
votes1
answer281
viewsWhen testing my web API C# ASP.NET locally on Fiddler it returns an error 404
I am creating a stock control system with integration of android app,the connection is being made through a Web Service API. However I can not test the methods that exist in it to see the returned…
-
0
votes0
answers70
viewsWeb Api Calls 2
Well, I have a somewhat boring task that is the handling of Cookies, I make a request by sending as parameter a code that I want to access, my API opens the page with Webdriver, maps and takes the…
-
0
votes1
answer62
viewsIs it necessary to enable Cross-Origin Requests for ASP.NET Web API?
I made a test application, where I point to a web api that’s online, the address of this api works and return the data if it’s posted to the browser URL, it does a GET. In the test application I…
-
0
votes1
answer1894
viewsError: The request Entity’s media type 'Multipart/form-data' is not supported for this Resource
I’m trying to make a POST in a Webapi that is returning me the following error: The request Entity’s media type 'Multipart/form-data' is not supported for this Resource. Exceptionmessage: No…
-
0
votes1
answer327
viewsProblems accessing a web api in a Xamarin Forms project
On my first screen of mine app mobile what I’m doing is the screen of Login, but whenever I try to log the return is Statuscode: 404, Reasonphrase: 'Not Found' I have confirmed and the uri is…
-
0
votes1
answer223
viewsView image ( from web api ) without extension in php
I’m accessing the web api of Spotify and extracting the images from the albums, the problem is that so far the code is static and you can easily insert images with the following method: <style…
-
0
votes2
answers925
viewsIs it possible to make a synchronous call to Webapi?
It is possible to make non-synchrone calls to WebApi? I don’t want my application to pass beaten by the method that executes the query to WebApi, I want her to expect a response and take an attitude…
-
0
votes1
answer96
viewsWeb api 2 within MVC project. How to prevent redirection to login page when token is not valid
I’m doing a Rest API on an MVC project. On the API controllers (ApiController) place the Dataannotation Authorize, when the token entered is invalid, it detects and tries to redirect to the login…
-
0
votes0
answers188
viewsHow to customize the HTTP return message/code of an expired/invalid token in Web Api 2 + Owin?
When my token expires and becomes invalid, I get a 404 (Not found) error return, but the truth is it should be a 401 (Unauthorized). The problem is I don’t know how to customize it. I’m using…
-
0
votes1
answer86
viewsDoubt Verb GET Webapi
Currently I have some compositions in my model that make relationship with other tables of my bank. When I went to assemble the get to bring me all the related data, I had several problems and…
-
0
votes1
answer210
viewsASP.NET Web API post Byte[]
I’m creating a Web API and my model has a property byte[], but every time I try to make a Post my model arrives null, taking away the property byte[] he usually arrives the model. [Table("Pessoas")]…
-
0
votes0
answers35
views"Method Not Found" and "Method Not Allowed" using Webapi and POST
I am developing a picking software, where the user from a sales order (order) creates a picking list (which contain the products that the warehouse employee will pick up for later transport to take…
-
0
votes1
answer243
viewsError making a javascript API post
I’m trying to post on the API using JSON, but it always returns page error not found. But I’m sure that the URL is correct, because when I use "POSTMAN" works perfectly. Follow the javascript code.…
-
0
votes1
answer288
viewsReturn of Webapi Dynamic types
I am writing a method in Webapi that returns the type Httpresponsemessage. I have an appointment that returns a type Dynamic that would return the query of the data as it is different information.…
-
0
votes1
answer184
viewsEF Core Complex Object Insertion with Webapi
I am developing a Webapi (.NET) application with Entityframework Core. I implemented the following entities: Pais.Cs public class Pais { [Key] public int Id { get; set; } [MaxLength(100), Required]…
-
0
votes0
answers275
viewsHow to capture the body value (Stream) of a request without deleting it?
I’m trying to capture the body of a request in an authorization class (Authorizationhandler), but because this body is a Stream, after reading its contents the post request that comes next can not…
-
0
votes0
answers73
viewsProblems with the. NET Framework version
I have an ASP.Net MVC 5 and Webapi application, in version . NET 4.5.2 and post them to my FTP server I have the following error (image at the end of the post) And asking for the company’s technical…
-
0
votes0
answers108
viewsError making POST from a json to a Web API
It’s giving me an error when I try to make a POST to the API that error is: System.Net.Webexception: Remote server returned an error: (405) Method not allowed. The code I’m using is: var…
-
0
votes1
answer236
viewsLambda or Linq brings me all the fields and not only those of expression
Just for learning even, understand the section. I did a lambda of a bank with only 6 fields, like this: public List<LiberacaoDTO> getAutoriza(int idorcamento) { var lista = contexto.Liberacoes…
-
0
votes2
answers366
viewsReturn an object from two or more tables to the fields
I have done some posts on Rest and Lambda, and to give a close on this subject(I hope), I have a question. A colleague here at the site recommended that I create a DTO and bring the database data…