0
    [HttpPost, Route("api/EtiketAPI/EtiketEkle/{makaleId}")]
    public HttpResponseMessage EtiketEkle(string makaleId,Etiket[] values)

I have been recently using web api. I am stuck to bind an array which comes from web request and the request method is post method. Is there any way to bind data comes from request to my specified object ?

I am sending data with angularjs. Here is data form

[{"EtiketId":1,"EtiketAdi":"Microsoft","EtiketRadi":"microsoft","Makaleler":null},{"EtiketId":2,"EtiketAdi":".net","EtiketRadi":"-net","Makaleler":null}]

and my class

public class Etiket
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int EtiketId { get; set; }
    public string EtiketAdi { get; set; }
    public string EtiketRadi { get; set; }
    public virtual ICollection<Makale> Makaleler { get; set; }

}
Huseyin
  • 3
  • 4

1 Answers1

0

here are you answers :

  1. Sending binary data along with a REST API request
  2. Processing binary data in Web API from a POST or PUT REST request
Community
  • 1
  • 1
MRP
  • 499
  • 5
  • 24