Skip to content

comoum/curleasy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

curleasy

使用odin自带vendor的curl简单包装post、get请求

用法

也可以看看easy_test.odin文件

  1. 用git克隆当前仓库
  2. 在自己项目中导入当前仓库, import "curleasy"
  3. (可选)设置log的过程(函数)(core:log)用来打印一些日志, 当前仓库使用了log.warnf, 在easyGeteasyPost时指定verbose参数时使用了log.infof
  4. 开始使用, 见下面例子
// 设置日志
logger := log.create_console_logger()
defer log.destroy_console_logger(logger)
context.logger = logger

easy := Easy_get(
  "http://www.baidu.com",
  []string {
    "user-agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0",
    "content-type: text/plain",
  },
  verbose = false,
)
defer Easy_free(easy)

About

用odin自带vendor使用http post、get的简单调用

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages