gin bind自动omitempty问题

Posted by 夏泽民

type Foo struct { Bar bool json:"bar" binding:"required" // True / False } When I send a JSON request with the value true it works, but when I send the same request with false I get the following error.



dnsutils bind-tools

Posted by 夏泽民

dig and nslookup are in dnsutils on Ubuntu (debian) Install dig and nslookup on Alpine dig and nslookup are in bind-tools on Alpine:



confluent-kafka-go mac m1

Posted by 夏泽民

./configure –prefix=/opt/homebrew –arch=arm64 –enable-static



SearchType

Posted by 夏泽民

ES的搜索分scatter/gather两个步骤:



http 302 303 307

Posted by 夏泽民

RFC1945(http://tools.ietf.org/html/rfc1945#page-34),也就是HTTP1.0在介绍302时说,如果客户端发出POST请求后,收到服务端的302状态码,那么不能自动的向新的URI发送重复请求,必须跟用户确认是否该重发,因为第二次POST时,环境可能已经发生变化(嗯,POST方法不是幂等的),POST操作会不符合用户预期。但是,很多浏览器(user agent我描述为浏览器以方便介绍)在这种情况下都会把POST请求变为GET请求。 RFC2616(http://tools.ietf.org/html/rfc2616#section-10.3.3),也就是HTTP1.1在介绍302时说,如果客户端发出非GET、HEAD请求后,收到服务端的302状态码,那么就不能自动的向新URI发送重复请求,除非得到用户的确认。(又是-,-)但是,很多浏览器都把302当作303处理了(注意,303是HTTP1.1才加进来的,其实从HTTP1.0进化到HTTP1.1,浏览器什么都没动),它们获取到HTTP响应报文头部的Location字段信息,并发起一个GET请求。

状态码——303和307


Search

Popular posts

Anything in here will be replaced on browsers that support the canvas element

Recent posts

This blog is maintained by 夏泽民

Get in touch with me at 465474307@qq.com

Subscribe to our mailing list

* indicates required