mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-02 03:28:25 +08:00
commands/http: Send request arguments in client requests
This commit is contained in:

committed by
Juan Batiz-Benet

parent
753162529a
commit
42633e5d40
@ -34,10 +34,12 @@ func Send(req cmds.Request) (cmds.Response, error) {
|
|||||||
req.SetOption(cmds.EncShort, encoding)
|
req.SetOption(cmds.EncShort, encoding)
|
||||||
|
|
||||||
query := "?"
|
query := "?"
|
||||||
options := req.Options()
|
for k, v := range req.Options() {
|
||||||
for k, v := range options {
|
|
||||||
query += "&" + k + "=" + v.(string)
|
query += "&" + k + "=" + v.(string)
|
||||||
}
|
}
|
||||||
|
for _, v := range req.Arguments() {
|
||||||
|
query += "&arg=" + v
|
||||||
|
}
|
||||||
|
|
||||||
httpRes, err := http.Post(url+query, "application/octet-stream", req.Stream())
|
httpRes, err := http.Post(url+query, "application/octet-stream", req.Stream())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user