Array Indices #3
Description
It looks like Canvas is expecting URL parameters for arrays that do not include numerical indices. For example, Canvas would expect this:
http://canvas-instance.instructure.com/api/v1/courses/123/sections?include[]=students&include[]=enrollments
At the same time http_build_query()
is trying to build legal URL parameters, which require that at least the base URL be indexed, resulting in shenanigans like this:
http://canvas-instance.instructure.com/api/v1/courses/123/sections?include%5B0%5D=students&include%5B1%5D=enrollments
It appears, at least, that Canvas tolerates URL-encoded arrays, but not the indices, so a request like this would work, allowing the result of http_build_query()
to be post-processed as described here:
http://canvas-instance.instructure.com/api/v1/courses/123/sections?include%5B%5D=students&include%5B%5D=enrollments
Moreover, it appears that Pest
calls Pest::prepData()
for Pest::put()
and Pest::post()
only, essentially as a check to see if a file upload is included as part of the data parameters, but reconfiguring Pest::get()
would require essentially overriding the entire method, as it embeds the http_build_query()
call in the method, without calling Pest::prepData()
.