diff --git a/drivel.go b/drivel.go index d07bf73..7b3c84a 100644 --- a/drivel.go +++ b/drivel.go @@ -131,7 +131,7 @@ func send(client *http.Client, url string, vals url.Values) []byte { log(err) defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) - if resp.StatusCode != http.StatusOK { + if resp.StatusCode < 200 || resp.StatusCode > 299 { fmt.Fprintln(os.Stderr, "response:", resp, "\n") fmt.Fprintln(os.Stderr, "body:", string(body), "\n") log(errors.New("HTTP status " + fmt.Sprint(resp.StatusCode)))