Black API’s – Request Line

Nog voordat The Black Eyed Peas doorbraken met “Where is the love” in 2003 strandden de eerste nummers nog in de Tipparade. Zoals “Request line” in 2001, waar ook het unieke stemgeluid is te horen van Macy Gray. Het ophalen van gegevens op internet gaat ook via een request line. In de browser vraag je HTML pagina’s op en applicaties wisselen gegevens uit met een webAPI.

Lees verder “Black API’s – Request Line”

WDTBD: [FromUri]

I have an action method in my MVC Api controller. It is invoked as [httpget], so parameters are passed through in the querystring. In my case it’s an integer array:

Mydomain.com/[controllername]/[action]?id=1&id=2&id=3

But when I want to use parameter ‘id’ in my code, why is it null and not an array?

Obviously I need to add FromUri.

 [HttpGet]
 public HttpResponseMessage ChangeStateOfUsers([FromUri] int[] ids, bool state)

Didn’t read about it before.

 

Maak een gratis website of blog op WordPress.com.

Omhoog ↑