소스 검색

http RAW can take optional data body.

master
Patrick Peng Sun 8 년 전
부모
커밋
a67c242814
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. +5
    -1
      upload.go

+ 5
- 1
upload.go 파일 보기

@@ -70,7 +70,11 @@ func putRAW(data []byte, targetURL string, headers map[string]string) (resp stri
}

func httpRaw(httpMethod, targetURL string, data []byte, headers map[string]string) (resp string, err error) {
req, err := http.NewRequest(httpMethod, targetURL, bytes.NewBuffer(data))
requestBody := io.Reader(nil)
if data != nil {
requestBody = bytes.NewBuffer(data)
}
req, err := http.NewRequest(httpMethod, targetURL, requestBody)
if err != nil {
return
}

Loading…
취소
저장