Questions tagged as 'asp.net-web-api'

1
answer

Web API authenticate with SQL Server users

Hello,   I currently have an offline application that uses SQL Server users to login to the application. What I want to do is to use the same users to generate an authentication Token in an Asp.net Core Web API. How can I generate this Tok...
asked by 14.07.2017 / 19:54
1
answer

Integration tests in complex API scenarios

Good afternoon, For a simple scenario I delete all records from the database tables before running each integration test. My question is the following how to prepare the test database for complex environments, example to carry out the issu...
asked by 12.06.2017 / 20:44
1
answer

Personalized WebApi Response

Hello, I have a WebApi service and would like to get an answer specifically with a Date, but by the time I call that service and I get the return from my PostAsync what I see is just an httpResult saying that was OK. call to WebApi var result...
asked by 01.06.2017 / 00:47
1
answer

Error making a post in the API with javascript

I'm trying to make a post in the API, using JSON, but it always returns page error not found. But I'm sure the URL is correct, because when I use "POSTMAN" it works perfectly. Follow the javascript code. var btncadastro = document.querySele...
asked by 29.05.2017 / 04:06
0
answers

"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 pick list (which contain the products that the warehouse clerk will fetch and then transport the person to the house ). Whenever I try to create a new pick...
asked by 24.05.2017 / 22:05
0
answers

Consuming WEB API ASP.NET MVC 4 [ERROR]

I have a problem ... I put my web api in locaweb ... 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, Content : System.Net.Http.StreamContent ". I though...
asked by 30.05.2017 / 23:35
1
answer

WCF + Web API - How to integrate?

I'm developing a web api and need to integrate with a service from a third party that is a WCF. I have the WSDL definition, I integrated it into my solution as a service reference, but it is pointing to a physical file on my PC. How do I inte...
asked by 25.04.2017 / 20:09
1
answer

Filter a NULL type in lambda expression or linq

Hello, my A entity has an attribute of type long that can be NULL making a relationship with entity B , making a filter with a Lambda expression with this attribute to bring up all records that are different from NULL it does not recogniz...
asked by 06.04.2018 / 13:37
1
answer

Web api 2 within MVC project. How to prevent redirection to the login page when the token is not valid

I'm doing an API Rest in an MVC project. In the API controllers ( ApiController ) I place the DataAnnotation Authorize , when the token entered is invalid, it detects and tries to redirect to the login page. But I do not want this be...
asked by 02.02.2017 / 21:05
2
answers

Is it possible to make a synchronous call to WebApi?

Can non-asynchronous calls be made to WebApi ? I do not want my application to get hit by the method that runs the query with WebApi , I want it to wait for a response and take action according to the return, but all examples I...
asked by 31.01.2017 / 22:31