Fix nil error for GET requests
This commit is contained in:
parent
d0085ab2c3
commit
b475da66da
@ -15,7 +15,8 @@ func SendRequest(url string, method string, headers map[string]string, body inte
|
|||||||
var contentType string
|
var contentType string
|
||||||
|
|
||||||
switch v := body.(type) {
|
switch v := body.(type) {
|
||||||
case nil: // Leave nil for GET requests
|
case nil:
|
||||||
|
reqBody = bytes.NewBuffer([]byte(""))
|
||||||
case map[string]string:
|
case map[string]string:
|
||||||
reqBody = &bytes.Buffer{}
|
reqBody = &bytes.Buffer{}
|
||||||
writer := multipart.NewWriter(reqBody)
|
writer := multipart.NewWriter(reqBody)
|
||||||
|
Loading…
Reference in New Issue
Block a user