go-simple-api:使用GoLang的简单API

时间:2021-02-11 10:46:38
【文件属性】:
文件名称:go-simple-api:使用GoLang的简单API
文件大小:10KB
文件格式:ZIP
更新时间:2021-02-11 10:46:38
Go 使用GoLang的简单API 需求 > = 1.11 怎么跑 克隆回购 在终端/ CLI中运行: go build && ./go-simple-api 等待依赖下载 当您看到starting serve on :8080时,一切都已设置 示例API列表 GET GET GET GET POST 您可以使用自己的浏览器获取请求,我建议使用POSTMAN进行发布请求。 样品卷曲以供后期要求: curl --location --request POST 'http://localhost:8080/post_with_json_body' \ --header 'Content-Type: text/plain' \ --data-raw '{ "yourName" : "Chaidir Yahya", "userID" : 12345 }' 邮递员: 样本用户ID:1
【文件预览】:
go-simple-api-master
----go.mod(147B)
----services()
--------sample_post_with_json_body.go(286B)
--------sample_get.go(437B)
--------types.go(309B)
--------sample_get_with_route_query_param_test.go(1KB)
--------sample_get_with_route_query_param.go(547B)
----utils()
--------response.go(275B)
----go.sum(1KB)
----app.go(780B)
----handlers()
--------sample_post_with_json_body.go(1KB)
--------home.go(460B)
--------sample_get.go(686B)
--------sample_get_with_route_param.go(1012B)
--------types.go(269B)
--------sample_get_with_query_param.go(949B)
--------not_found.go(436B)
--------sample_get_with_route_param_test.go(1KB)
----.gitignore(14B)
----readme.md(1KB)

网友评论