Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ type Client struct {
mu sync.Mutex
EncodingBase64 bool
Connected bool
Body io.Reader
Method string
}

// NewClient creates a new client
Expand Down Expand Up @@ -289,7 +291,10 @@ func (c *Client) OnConnect(fn ConnCallback) {
}

func (c *Client) request(ctx context.Context, stream string) (*http.Response, error) {
req, err := http.NewRequest("GET", c.URL, nil)
if c.Method == "" {
c.Method = "GET"
}
req, err := http.NewRequest(c.Method, c.URL, c.Body)
if err != nil {
return nil, err
}
Expand Down