Skip to content

Commit

Permalink
Merge pull request #11 from wklken/fix_get_header
Browse files Browse the repository at this point in the history
Fix get header
  • Loading branch information
wklken authored Jan 13, 2022
2 parents d55d807 + c01eb2c commit 223296e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gorequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ func (s *SuperAgent) Get(targetUrl string) *SuperAgent {
s.Method = GET
s.Url = targetUrl
s.Errors = nil
s.TargetType = ""
return s
}

Expand Down Expand Up @@ -1279,6 +1280,9 @@ func (s *SuperAgent) MakeRequest() (*http.Request, error) {
if contentReader != nil {
contentType = mw.FormDataContentType()
}
case "":
contentType = ""
contentReader = nil
default:
// let's return an error instead of an nil pointer exception here
return nil, fmt.Errorf("TargetType '%s' could not be determined", s.TargetType)
Expand Down

0 comments on commit 223296e

Please sign in to comment.