weixin_39825722
2020-12-26 09:05Restful routes
This PR is regarding issue https://github.com/tektoncd/dashboard/issues/18:
Changes:
- writeResponseLocation
function that sets the StatusCode to 201 and sets the "Content-Location"
header appropriately (to be used within POST routes)
- New test routes_test.go/TestContentLocation201
ensures that all POST routes MUST have a matching GET route and validates the 201 StatusCode and the resource that is identified within the "Content-Location"
header.
- New test routes_test.go/TestPut204
ensures PUT routes return 204
- Consolidate secretToCredential function that was implemented twice between credentials/credentials_test.go
- Modify {id}
within route to {name}
for credentials to align with other endpoints (and necessary credentials changes to allow for this)
- Modified routes to remove trailing slashes (new test ensures this best practice is maintained)
- Removed Consumes/Produces calls on /health
endpoint
- Small cleanups
- Updated DEVELOPMENT.md
该提问来源于开源项目:tektoncd/dashboard
- 点赞
- 回答
- 收藏
- 复制链接分享
5条回答
为你推荐
- 在Goji中映射所有路线及其http方法
- routes
- 1个回答
- 用于文件上传但不使用ParseMultipartForm的GO REST端点
- curl
- 1个回答
- 如何使用Gin Web框架将参数传递给Golang中的路由器处理程序?
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 4个回答
- PHP - 在Laravel中使用参数进行路由
- laravel
- php
- 1个回答
- Flight PHP RESTful API不返回HTTP状态标头
- rest
- php
- 1个回答