package
0.0.0-20230703141307-5086de3faced
Repository: https://github.com/lstack-org/utils.git
Documentation: pkg.go.dev

# README

gt

功能介绍

http 请求工具,支持 Restfull 风格的请求,同时支持将respons数据序列化到结构体

example

用例见client_test.go

当前支持返还值绑定类型

  • JSON
  • YAML
  • BODY (string, []byte)

header 添加

  • 单个key SetHeader(key string, values ...string)
  • 多个key AddHeader(header http.Header)

# Functions

Body body decoder.
BytesToString 没有内存开销的转换.
LoopElem 不停地对指针解引用.
NewBodyDecode create a new body decoder.
NewClient return http default client.
NewDefaultClient return http default client and set Json header.
No description provided by the author

# Constants

BODY 可以解析 string,[]byte.
No description provided by the author
LogDebug Print request body and response.
LogInfo Print source host,method, request URL.
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
ErrUnknownType 未知错误类型.

# Structs

BodyDecode body decoder structure.
Client wrap http.Client, used for Do request.
Option http request option.

# Interfaces

No description provided by the author
Decoder is the decoding interface.

# Type aliases

No description provided by the author
LogLevel 日志打印等级.