201 is an ok status too
This commit is contained in:
parent
d067bebbd2
commit
1417812419
|
@ -91,8 +91,12 @@ func PostMsg(keyname string, key *rsa.PrivateKey, url string, msg []byte) error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if resp.StatusCode != 200 && resp.StatusCode != 202 {
|
resp.Body.Close()
|
||||||
resp.Body.Close()
|
switch resp.StatusCode {
|
||||||
|
case 200:
|
||||||
|
case 201:
|
||||||
|
case 202:
|
||||||
|
default:
|
||||||
return fmt.Errorf("http post status: %d", resp.StatusCode)
|
return fmt.Errorf("http post status: %d", resp.StatusCode)
|
||||||
}
|
}
|
||||||
log.Printf("successful post: %s %d", url, resp.StatusCode)
|
log.Printf("successful post: %s %d", url, resp.StatusCode)
|
||||||
|
|
Loading…
Reference in New Issue