zoukankan      html  css  js  c++  java
  • golang net/http 包

    https://studygolang.com/articles/9467

    https://www.jianshu.com/p/be3d9cdc680b

    客户端: 用来发送请求, 并处理返回结果. 涉及到的方法和结构有:

    http.NewRequest 
    http.Client // 结构体, 包含的方法有Get Post PostForm Head 这些方法通http.NewRequest创建请求的, Client中还有一个很重要的方法Do, 他时请求的正真执行者. 
    http.Get  http.Post  http.Head  http.PostForm 这些方法都是对http.Client方法的包装

    const (
    
        StatusContinue           = 100
    
        StatusSwitchingProtocols = 101
    
        StatusOK                   = 200
    
        StatusCreated              = 201
    
        StatusAccepted             = 202
    
        StatusNonAuthoritativeInfo = 203
    
        StatusNoContent            = 204
    
        StatusResetContent         = 205
    
        StatusPartialContent       = 206
    
        StatusMultipleChoices   = 300
    
        StatusMovedPermanently  = 301
    
        StatusFound             = 302
    
        StatusSeeOther          = 303
    
        StatusNotModified       = 304
    
        StatusUseProxy          = 305
    
        StatusTemporaryRedirect = 307
    
        StatusBadRequest                   = 400
    
        StatusUnauthorized                 = 401
    
        StatusPaymentRequired              = 402
    
        StatusForbidden                    = 403
    
        StatusNotFound                     = 404
    
        StatusMethodNotAllowed             = 405
    
        StatusNotAcceptable                = 406
    
        StatusProxyAuthRequired            = 407
    
        StatusRequestTimeout               = 408
    
        StatusConflict                     = 409
    
        StatusGone                         = 410
    
        StatusLengthRequired               = 411
    
        StatusPreconditionFailed           = 412
    
        StatusRequestEntityTooLarge        = 413
    
        StatusRequestURITooLong            = 414
    
        StatusUnsupportedMediaType         = 415
    
        StatusRequestedRangeNotSatisfiable = 416
    
        StatusExpectationFailed            = 417
    
        StatusTeapot                       = 418
    
        StatusInternalServerError     = 500
    
        StatusNotImplemented          = 501
    
        StatusBadGateway              = 502
    
        StatusServiceUnavailable      = 503
    
        StatusGatewayTimeout          = 504
    
        StatusHTTPVersionNotSupported = 505
    
    )
  • 相关阅读:
    1654. Minimum Jumps to Reach Home
    1129. Shortest Path with Alternating Colors
    1766. Tree of Coprimes
    1368. Minimum Cost to Make at Least One Valid Path in a Grid
    LeetCode 841 钥匙与房间
    LeetCode 268 缺失数字
    LeetCode 136 只出现一次的数字
    LeetCode 461 汉明距离
    LeetCode 557 反转字符串中的单词 III
    LeetCode 392 判断子序列
  • 原文地址:https://www.cnblogs.com/answercard/p/10545254.html
Copyright © 2011-2022 走看看