Query string parameters are only added if the URL contains a '?'
For some reason if an options object like this is submitted:
{
"method":"POST",
"path":"/v1.37/containers/...blah.../attach",
"options":{
"_body":{},
"_query":{
"logs":"true",
"stream":"true",
"stdin":"false",
"stdout":"true",
"stderr":"true"
}
},
"statusCodes":{"101":true,"200":true,"400":true,"404":true,"500":true},
"isStream":true
}
the parameters in _query are not added to the URL. However, if there is a question mark in the URL (in path), they are added:
{
"method":"POST",
"path":"/v1.37/containers/...blah.../attach?",
"options":{
"_body":{},
"_query":{
"logs":"true",
"stream":"true",
"stdin":"false",
"stdout":"true",
"stderr":"true"
}
},
"statusCodes":{"101":true,"200":true,"400":true,"404":true,"500":true},
"isStream":true
}
The line that causes this is modem.js#L115, but I'm wary of touching it since I'm not quite sure what the logic was.
This comes from way back. At the time the Docker API was very young. There were endpoints sending/posting data in very different ways and different signatures everywhere. Question mark was used in order to easily identify which ones used query string :)
Spent a bunch of time tracking this down today. Is this still relevant to the docker API?