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

2
answers

Web API Default Route does not work when it receives a parameter

I am using Web Api 2.0 together with MVC 5 This is my WebApiConfig config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional }...
asked by 04.04.2016 / 15:13
1
answer

Post Order (back and forth to BackEnd) from angularjs

I am trying to insert sections in a Database, to the whole insert I use with C # in controllers (My project is a WebApi). What I want is for you to make an insert in each cycle of the for. But the controller goes only once, and that's when the w...
asked by 25.08.2017 / 22:49
3
answers

Sending data to a Web Api

I'm doing a system with Entity Framework and Web Api. It has happened to me that I can only pass an object to the Api, I can not send a string, this why is it? Where do you configure that you only receive one object? and not only that, that the...
asked by 08.05.2017 / 14:49
1
answer

Convert image to base64 to view it in a view

Through a web api I am getting the path of an image stored on the server. The path is a string that I convert to an array of bytes and then convert it to a base64 image. When I visualize the image in the view, it does not throw an error but it d...
asked by 26.05.2017 / 19:47
1
answer

Sending data to an Api

I have two methods of type Post But what I do not know is how to differentiate one method from the other in the Post type request. [HttpPost] public ExpedienteDto Post(ExpedienteDto dto) { return ProcesosService.CrearExpedient...
asked by 25.09.2018 / 16:43
2
answers

Deliver JSON nested in WebAPI .net core

I need to deliver a JSON that has a TimelineItem where each timelineitem corresponds to a user. User class public class User { public int Id { get; set; } public string Name { get; set; } } Class timelineitem public cla...
asked by 19.12.2017 / 19:12
1
answer

how to consume a web api, from MVC.asp.net?

I have my Web API in ASP.NET , I need to make a simple abml consuming the services from the MVC driver. Could you help me? The WEB API that I have is the one that generates scaffolding     
asked by 16.08.2016 / 16:25
1
answer

How can I send two objects via ajax to a web api?

I need to send two objects to the post and update methods to an Api web, I work with c #, webapi, mvc. He is not taking it. var album = { nombre: "PowerAge", Fecha: "011/10/1979" } var user = { Name: "Rick" area: "operaciones"...
asked by 16.02.2016 / 17:35
1
answer

How to receive a POST request

I am connecting to an api which asks me as a final step to receive status notification through a POST, that is, the api sends me a request in POST type. I have developed a web servise in .asmx type [WebService(Namespace = " http://tempuri.org/...
asked by 29.09.2018 / 02:16
2
answers

Error 405 when consuming Api Rest service

I am having a problem when trying to consume an Api Rest service from Angular 6, my Angular code is as follows: GuardarDatos(datos:General):Observable<string> { const httpOptions = { headers: new HttpHeaders({ 'Content-Type'...
asked by 08.06.2018 / 23:31