高效 RESTful API 服务实现 rest-api-web

码农软件 · 软件分类 · REST/RESTful项目 · 2019-03-10 18:13:46

软件介绍

高效的 RESTful API 服务实现,基于 Jersey2 和嵌入式的轻量级的 servlet 容器 Jetty9, 这个是 war 包形式部署到 jetty 中运行,实现对用户的增、删、改、查操作,并且严格按照 RESTful 风格设计接口。

基于Jersey2 + Spring4 + MyBatis3 + Jetty9 实现,完全遵循 OpenAPI 设计规范,供开发 Web API 的开发人员做一个参考实现,并很容易在此基础上扩展功能。

接口演示:

根据id获取用户信息

http://localhost/api/v1/users/1

结果:

{
  "id" : 1,
  "name" : "张飞",
  "age" : 20,
  "password" : "zhangfei",
  "createdTime" : "2017-06-15 20:38:09",
  "updatedTime" : "2017-06-15 20:38:09"
}

 

注:下面几种使用chrome的Postman测试

创建新用户

http://localhost/api/v1/users POST

body参数:

{
  "id" : 3,
  "name" : "孙权",
  "age" : 24,
  "password" : "sunquan"
}

返回结果:

HTTP code:201

User was successfully created

更新用户

http://localhost/api/v1/users PUT

body参数:

{
  "id" : 3,
  "name" : "孙权",
  "age" : 25,
  "password" : "sunquan"
}

返回结果:

HTTP code:200

User was successfully updated

本文地址:https://codercto.com/soft/d/1058.html

The Web Designer's Idea Book

The Web Designer's Idea Book

Patrick Mcneil / How / 2008-10-6 / USD 25.00

The Web Designer's Idea Book includes more than 700 websites arranged thematically, so you can find inspiration for layout, color, style and more. Author Patrick McNeil has cataloged more than 5,000 s......一起来看看 《The Web Designer's Idea Book》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具