1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 10:49:24 +08:00

commands/http: Send request arguments in client requests

This commit is contained in:
Matt Bell
2014-10-28 17:28:11 -07:00
committed by Juan Batiz-Benet
parent 753162529a
commit 42633e5d40

View File

@ -34,10 +34,12 @@ func Send(req cmds.Request) (cmds.Response, error) {
req.SetOption(cmds.EncShort, encoding)
query := "?"
options := req.Options()
for k, v := range options {
for k, v := range req.Options() {
query += "&" + k + "=" + v.(string)
}
for _, v := range req.Arguments() {
query += "&arg=" + v
}
httpRes, err := http.Post(url+query, "application/octet-stream", req.Stream())
if err != nil {