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           = 

    StatusSwitchingProtocols = 

    StatusOK                   = 

    StatusCreated              = 

    StatusAccepted             = 

    StatusNonAuthoritativeInfo = 

    StatusNoContent            = 

    StatusResetContent         = 

    StatusPartialContent       = 

    StatusMultipleChoices   = 

    StatusMovedPermanently  = 

    StatusFound             = 

    StatusSeeOther          = 

    StatusNotModified       = 

    StatusUseProxy          = 

    StatusTemporaryRedirect = 

    StatusBadRequest                   = 

    StatusUnauthorized                 = 

    StatusPaymentRequired              = 

    StatusForbidden                    = 

    StatusNotFound                     = 

    StatusMethodNotAllowed             = 

    StatusNotAcceptable                = 

    StatusProxyAuthRequired            = 

    StatusRequestTimeout               = 

    StatusConflict                     = 

    StatusGone                         = 

    StatusLengthRequired               = 

    StatusPreconditionFailed           = 

    StatusRequestEntityTooLarge        = 

    StatusRequestURITooLong            = 

    StatusUnsupportedMediaType         = 

    StatusRequestedRangeNotSatisfiable = 

    StatusExpectationFailed            = 

    StatusTeapot                       = 

    StatusInternalServerError     = 

    StatusNotImplemented          = 

    StatusBadGateway              = 

    StatusServiceUnavailable      = 

    StatusGatewayTimeout          = 

    StatusHTTPVersionNotSupported = 

)

golang net/http 包的更多相关文章

  1. Golang爬虫示例包系列教程(一):pedaily.com投资界爬虫

    Golang爬虫示例包 文件结构 自己用Golang原生包封装了一个爬虫库,源码见go get -u -v github.com/hunterhug/go_tool/spider ---- data ...

  2. 一键解决 go get golang.org/x 包失败

    问题描述 当我们使用 go get.go install.go mod 等命令时,会自动下载相应的包或依赖包.但由于众所周知的原因,类似于 golang.org/x/... 的包会出现下载失败的情况. ...

  3. 19-03【golang】strings包

    golang的strings包提供了字符串操作的一系列函数.下面做个简单介绍 函数 用法 备注 Compare(a,b sring) 比较两个字符串   Contains(s, substr stri ...

  4. 关于golang.org/x包问题

    关于golang.org/x包问题 由于谷歌被墙,跟谷歌相关的模块无法通过go get来下载,解决方法: git clone https://github.com/golang/net.git $GO ...

  5. Golang Gin 项目包依赖管理 godep 使用

    Golang Gin 项目包依赖管理 godep 使用 标签(空格分隔): Go 在按照github.com/tools/godep文档go get完包以后,调整项目结构为$GOPATH/src/$P ...

  6. golang 关于golang.org/x包问题

    关于golang.org/x包问题 由于谷歌被墙,跟谷歌相关的模块无法通过go get来下载,解决方法: git clone https://github.com/golang/net.git $GO ...

  7. Golang的json包

    encoding/json encoding/json是官方提供的标准json, 实现RFC 7159中定义的JSON编码和解码.使用的时候需要预定义struct,原理是通过reflection和in ...

  8. Golang官方log包详解

    Golang官方log包详解 以下全是代码, 详解在注释中, 请从头到尾看 // Copyright 2009 The Go Authors. All rights reserved. // Use ...

  9. 从0写一个Golang日志处理包

    WHY 日志概述 日志几乎是每个实际的软件项目从开发到最后实际运行过程中都必不可少的东西.它对于查看代码运行流程,记录发生的事情等方面都是很重要的. 一个好的日志系统应当能准确地记录需要记录的信息,同 ...

  10. 关于golang的time包总结

    目录 前言 time包详解 总结 前言 各种编程语言都少不了与时间有关的操作,因为很多判断都是基于时间,因此正确和方便的使用时间库就很重要额. golang提供了import "time&q ...

随机推荐

  1. PHP类的继承

    每个子类(也叫派生类)都会在设置自己的属性前调用父类的构造方法.父类(也叫基类或超类)现在仅知道自己的数据,子类一般是父类的特例,要避免告诉父类任何关于子类的信息 以下为一个使用继承的实例: < ...

  2. Linux学习笔记11—VSFTP的搭建

    1.查看是否安装vsftp rpm -qa | grep vsftpd 如果出现vsftpd-2.0.5-21.el5,说明已经安装 vsftp 安装vsftp yum -y install vsft ...

  3. android常用工具收集

    1.脱壳工具 https://github.com/DrizzleRisk/drizzleDumper

  4. AngularJS中监视Scope变量以及外部调用Scope方法

    在AngularJS中,有时候需要监视Scope中的某个变量,因为变量的改变会影响一些界面元素的显示.有时,也希望通过jQuery调用Scope的某个方法. 比如以下场景: <div> & ...

  5. 你的项目真的需要Session吗? redis保存session性能怎么样?

    在web开发中,Session这个东西一直都很重要,至少伴随我10年之久, 前一段时间发生一个性能问题,因为Redis session 问题,后来想想 其实我的项目session 是不需要的. 先看看 ...

  6. Docker linux安装

    Ubuntu下安装 sudo wget -qO- https://get.docker.com/  | shsudo usermod -aG docker imooc Centos7下安装 CentO ...

  7. device eth0 does not seem to be present, delaying initialization(转)

    vmlite虚拟机启动出错,就把这个虚拟机删除掉重新建立,系统虚拟硬盘使用之前的,启动系统后不能上网,通过ifconfig查看网卡没启动,遂启动网卡服务,但是出错,就是:device eth0 doe ...

  8. s:if 标签 字符串比较 正确用法和错误用法

    transaction.tjpopState 该对象在后台是枚举类型,在前台需要转为字符串才能比较. 错误一: <s:if test='transaction.tjpopState!=" ...

  9. Vue(九):样式绑定v-bind示例

    Vue.js class class 与 style 是 HTML 元素的属性,用于设置元素的样式,我们可以用 v-bind 来设置样式属性. Vue.js v-bind 在处理 class 和 st ...

  10. 通过MTK迁移Mysql到EDB实战指南

    1.1 迁移准备 下图是Migration toolkit(MTK)可使用的迁移功能 1 查看一下迁移源数据库testdb信息.共三张表 watermark/2/text/aHR0cDovL2Jsb2 ...