设置请求content type
(s string)
| 27 | |
| 28 | //设置请求content type |
| 29 | func (h *Http) SetContentType(s string) *Http { |
| 30 | switch s { |
| 31 | case "form": |
| 32 | h.SetHeader("Content-Type", "application/x-www-form-urlencoded") |
| 33 | case "json": |
| 34 | h.SetHeader("Content-Type", "application/json;charset=UTF-8") |
| 35 | default: |
| 36 | h.SetHeader("Content-Type", s) |
| 37 | } |
| 38 | return h |
| 39 | } |
no test coverage detected