File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -183,10 +183,14 @@ func validateAddContacts(contactIDs []string) error {
183
183
}
184
184
185
185
// addContactsQuery gets a query string to add contacts to a group. We're using
186
- // the alternative "/foo?_method=PUT&key=value" syntax to send the contact IDs
186
+ // the alternative "/foo?_method=PUT&key=value" format to send the contact IDs
187
187
// as GET params. Sending these in the request body would require a painful
188
188
// workaround, as client.Request sends request bodies as JSON by default. See
189
189
// also: https://developers.messagebird.com/docs/alternatives.
190
+ //
191
+ // It should also be noted that we're intentionally not using url.Values for
192
+ // building the query string: the API expects `ids[]=foo&ids[]=bar` format,
193
+ // while url.Values encodes to `ids=foo&ids=bar`.
190
194
func addContactsQuery (contactIDs []string ) string {
191
195
// Slice's length is one bigger than len(IDs) for the _method param.
192
196
params := make ([]string , 0 , len (contactIDs )+ 1 )
You can’t perform that action at this time.
0 commit comments