你的位置:首页 > 软件开发 > ASP.net > Postman测试Web API

Postman测试Web API

发布时间:2016-02-17 14:00:06
如何查看查询字符串?→输入包含查询字符串的URL,比如:http://localhost:54176/api/ProductCategories?name=darren&age=25→点击Params,查询字符串以键值队集合的形式存储& ...

 

如何查看查询字符串?→输入包含查询字符串的URL,比如:http://localhost:54176/api/ProductCategories?name=darren&age=25→form-data选项,输入表单数据{这里准备了一些API需要测试:GET     /categoriesPOST    /categories/{id}/products→点击No environment创建环境变量host: http://localhost→GET请求GET {{host}}:{{port}}/categoriesPOST请求测试?■ 创建cateogory==请求POST {{host}}:{{port}}/categoriesHeaders:Content-Type: application/jsonBody:{==响应status 201 created{■ 创建productPOST {{host}}:{{port}}/categories/1/productsHeaders:Content-Type: application/jsonBody:{==响应status 201 created{==请求PUT {{host}}:{{port}}/categories/1Headers:Content-Type: application/jsonBody:{==响应status 200 ok{DELETE {{host}}:{{port}}/categories/1{==请求GET {{host}}:{port}/categories/1/products?name=h==响应status 200 ok[验证授权?验证解决是谁的问题。授权解决能做什么的问题。通常的情形是:→ 输入用户名和密码POST .../auth/loginContent-Type: application/jsonBody:{→ 服务端返回token在响应中获取到token→ 再次请求在Headers中放入tokenGET ../categoriesHeaders:token:.....


 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:Postman测试Web API

关键词:web

web
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。