瀏覽代碼

Merge pull request #139 from noisypixy/develop

Replace HTTP status codes for net/http constants.
Bruce 8 年之前
父節點
當前提交
d0c30f0f14
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      restapi.go

+ 2 - 3
restapi.go

@@ -104,11 +104,10 @@ func (s *Session) request(method, urlStr, contentType string, b []byte) (respons
 		fmt.Printf("API RESPONSE    BODY :: [%s]\n", response)
 	}
 
-	// See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
 	switch resp.StatusCode {
 
-	case 200: // OK
-	case 204: // No Content
+	case http.StatusOK:
+	case http.StatusNoContent:
 
 		// TODO check for 401 response, invalidate token if we get one.