Added support for arrays in query string #282

Merged
merged 1 commit into from Jul 16, 2015

Projects

None yet

3 participants

@jbvanzuylen
Contributor

Examples:

GET /elements?type[]=IMAGE&type[]=VIDEO
GET /translations?language[]=en&language[]=fr&language[]=de
@jbvanzuylen jbvanzuylen Added support for arrays in query string
Examples:

```
/elements?type[]=IMAGE&type[]=VIDEO
/translations?language[]=en&language[]=fr&language[]=de
```
376ca1d
@guillaume-boivin
Contributor

👍

@atuttle
Owner
atuttle commented Jul 16, 2015

This looks great, thanks! Is this the format that jQuery sends when your AJAX data attribute contains an array? It looks familiar but I'm not a regular user of the format...

@jbvanzuylen
Contributor

Hello Adam,

Yes, jQuery will call this URL:

GET /translations?language[]=en&language[]=fr&language[]=de

with this code:

var params = {
  languages: ["en", "fr", "de"]
};
$.ajax({
  type: "GET",
  url: "translations",
  data: params
});
@atuttle atuttle added this to the Taffy 3.1 milestone Jul 16, 2015
@atuttle atuttle merged commit 7aba85e into atuttle:master Jul 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment