当前位置: 首页 > news >正文

珠海营销网站建设做网站需要固定ip么

珠海营销网站建设,做网站需要固定ip么,濮阳吧,wordpress 百度蜘蛛文章目录 说明效果创建GET请求没有参数带有参数带有环境变量带有动态参数 说明 首先通过###三个井号键来分开每个请求体#xff0c;然后请求url和header参数是紧紧挨着的#xff0c;请求参数不管是POST的body传参还是GET的parameter传参#xff0c;都是要换行的#xff0c;… 文章目录 说明效果创建GET请求没有参数带有参数带有环境变量带有动态参数 说明 首先通过###三个井号键来分开每个请求体然后请求url和header参数是紧紧挨着的请求参数不管是POST的body传参还是GET的parameter传参都是要换行的需要遵守HTTP协议规范 GET请求 ### GET request with a header GET https://httpbin.org/ip Accept: application/json### GET request with parameter GET https://httpbin.org/get?show_env1 Accept: application/json### GET request with environment variables GET {{host}}/get?show_env{{show_env}} Accept: application/json### GET request with disabled redirects # no-redirect GET http://httpbin.org/status/301### GET request with dynamic variables GET http://httpbin.org/anything?id{{$uuid}}ts{{$timestamp}}### POST请求 ### Send POST request with json body POST https://httpbin.org/post Content-Type: application/json{id: 999,value: content }### Send POST request with body as parameters POST https://httpbin.org/post Content-Type: application/x-www-form-urlencodedid999valuecontent### Send a form with the text and file fields POST https://httpbin.org/post Content-Type: multipart/form-data; boundaryWebAppBoundary--WebAppBoundary Content-Disposition: form-data; nameelement-name Content-Type: text/plainName --WebAppBoundary Content-Disposition: form-data; namedata; filenamedata.json Content-Type: application/json ./request-form-data.json --WebAppBoundary--### Send request with dynamic variables in requests body POST https://httpbin.org/post Content-Type: application/json{id: {{$uuid}},price: {{$randomInt}},ts: {{$timestamp}},value: content }###效果 点击项目目录右键操作newHttp Request hello.http GET http://localhost:8080/validSingleColumn Accept: application/jsonRUN 返回信息 GET http://localhost:8080/validSingleColumnHTTP/1.1 200 Content-Type: application/json Transfer-Encoding: chunked Date: Thu, 27 Jul 2023 06:28:03 GMT Keep-Alive: timeout60 Connection: keep-alive{msg: 操作成功,code: 200,data: [1,2,3,4,5] }Response code: 200; Time: 49ms; Content length: 54 bytes 在resource下面新建一个包如rest、http之类的名字随便取在这里面我们来创建我们的请求。 创建GET请求 没有参数 GET http://localhost:8080/hello Accept: application/json controller GetMapping(value hello)public AjaxResult hello(){return AjaxResult.success(hello);}响应信息 GET http://localhost:8080/helloHTTP/1.1 200 Content-Type: application/json Transfer-Encoding: chunked Date: Thu, 27 Jul 2023 06:41:52 GMT Keep-Alive: timeout60 Connection: keep-alive{msg: hello,code: 200 }Response code: 200; Time: 279ms; Content length: 26 bytes 带有参数 第一种形式:使用RequestParam单个参数 GetMapping(value /getFirst)public AjaxResult getFirst(RequestParam String id) {log.info(id:【{}】, id);return AjaxResult.success(使用RequestParam单个参数);}GET http://localhost:8081/hello/getFirst?id1 Accept: application/jsonGET http://localhost:8081/hello/getFirst?id1HTTP/1.1 200 Content-Type: application/json Transfer-Encoding: chunked Date: Thu, 27 Jul 2023 06:59:52 GMT Keep-Alive: timeout60 Connection: keep-alive{msg: 使用RequestParam单个参数,code: 200 }Response code: 200; Time: 62ms; Content length: 40 bytes第二种方式不使用RequestParam单个参数 GetMapping(value getSecond) public AjaxResult getSecond(String id) {log.info(id:【{}】, id);return AjaxResult.success(不使用RequestParam单个参数。); }GET http://localhost:8081/hello/getSecond?id2 Accept: application/json GET http://localhost:8081/hello/getSecond?id2HTTP/1.1 200 Content-Type: application/json Transfer-Encoding: chunked Date: Thu, 27 Jul 2023 07:01:52 GMT Keep-Alive: timeout60 Connection: keep-alive{msg: 不使用RequestParam单个参数。,code: 200 }Response code: 200; Time: 14ms; Content length: 42 bytes 第三种方式多个基础参数 GetMapping(value getThird)public AjaxResult getThird(String id, int age) {log.info(id:【{}】,age:【{}】, id, age);return AjaxResult.success(多个参数);}GET http://localhost:8081/hello/getThird/?id18age16 Accept: application/jsonGET http://localhost:8081/hello/getThird/?id18age16HTTP/1.1 200 Content-Type: application/json Transfer-Encoding: chunked Date: Thu, 27 Jul 2023 07:05:24 GMT Keep-Alive: timeout60 Connection: keep-alive{msg: 多个参数,code: 200 }Response code: 200; Time: 15ms; Content length: 25 bytes 第四种方式多个参数使用RequestParam GetMapping(value getFourth)public AjaxResult getFourth(RequestParam String id, RequestParam int age) {log.info(id:【{}】,age:【{}】, id, age);return AjaxResult.success(多个参数使用RequestParam);}GET http://localhost:8081/hello/getFourth?id18age16 Accept: application/json GET http://localhost:8081/hello/getFourth?id18age16HTTP/1.1 200 Content-Type: application/json Transfer-Encoding: chunked Date: Thu, 27 Jul 2023 07:07:19 GMT Keep-Alive: timeout60 Connection: keep-alive{msg: 多个参数使用RequestParam,code: 200 }Response code: 200; Time: 20ms; Content length: 40 bytes 第五种方式map入参使用RequestParam其实加不加一样效果 GetMapping(value getFifth)public AjaxResult getFifth(RequestParam Map map) {log.info(map:【{}】, map);return AjaxResult.success(map使用RequestParam);}GET http://localhost:8081/hello/getFifth?id1age10 Accept: application/jsonGET http://localhost:8081/hello/getFifth?id1age10HTTP/1.1 200 Content-Type: application/json Transfer-Encoding: chunked Date: Thu, 27 Jul 2023 07:13:03 GMT Keep-Alive: timeout60 Connection: keep-alive{msg: map使用RequestParam,code: 200 }Response code: 200; Time: 13ms; Content length: 39 bytes 第六种实体类使用 GetMapping(value getSeven)public AjaxResult getSeven(User user) {log.info(user:【{}】, user);return AjaxResult.success(实体类);}GET http://localhost:8081/hello/getSeven?id10age10userNamepmb Accept: application/jsonGET http://localhost:8081/hello/getSeven?id10age10userNamepmbHTTP/1.1 200 X-xr-bookmark: 1b995c1b-c0c7-4b3b-8d9b-9c0c008f7b32 Content-Type: application/json Transfer-Encoding: chunked Date: Thu, 27 Jul 2023 07:30:10 GMT Keep-Alive: timeout60 Connection: keep-alive{msg: 实体类,code: 200 }Response code: 200; Time: 75ms; Content length: 24 bytes 总结接收一个参数String、Long接收一个集合Map   GET 请求 测试发现 使用 RequestParm 可以接收到参数   GET 请求 测试发现 不加 RequestParm 也可以接收到参数 接受一个对象user   GET 请求 测试发现 使用 RequestParm 接收对象 报错 接收不到   GET 请求 测试发现 不加 RequestParm 接收对象 可以接收 总结 GET 请求 当使用 RequestParm 注解 和 不加注解时只能接收到 params 携带的参数 参数放在 请求头 和请求体中均接受不到。 带有环境变量 带有动态参数 接收一个参数String、Long、IntegerRequestParm 可以。 接收一个集合MapRequestParm 和 RequestBody 均可以。 接收一个对象user RequestBody 均可以。 总结POST请求 当使用 RequestParm 注解 和 不加注解时只能接收到 params 和请求体xxx格式携带的参数加注解无法接收到对象参数。
http://www.hkea.cn/news/14569811/

相关文章:

  • 北京大兴做网站公司网站策划书10个点怎么写
  • 表白网页在线生成网站网站建设调查内容有哪些
  • 专业外贸网站建设公司网站建设找星火龙
  • 免费数据网站用asp做网站有哪控件
  • 网站控制面板地址建设网站是什么职位
  • 网站 标题 关键词 描述网站内页产品 首页推荐
  • 网站建设流程行业现状微信怎么做网站推广
  • 网站三网合一什么意思广州网站改版设计制作
  • 在网络上做兼职的网站做网站交易装备可以么
  • 邢台做wap网站的地方青岛城阳网站设计
  • 网站建设毕业设计中期检查指数基金定投技巧
  • 临海做网站如何在建设银行网站申购纪念币
  • 网站建设全程揭秘光盘文件天津网站建设 seo
  • 招工网站58同城建立一个小程序多少钱
  • 忘记网站后台登陆地址天津seo培训机构
  • 重庆网站推广的网站wordpress news
  • wap网站技术房地产网站大全
  • 雷电模拟器手机版下载官方网站网页设计实验报告问题讨论
  • 网站通栏如何做特效h5在线制作免费版
  • 能发锚文本的网站wordpress 获取当前page id
  • 广州网站优化地址建筑业大数据服务平台
  • 江苏网站建设哪家有明年做哪些网站能致富
  • php网站后台模板下载网站建设文化服务公司
  • 网站开发运维机构设置免费做代理又不用进货
  • dnf怎么做辅助网站哪个网站可以领手工活在家做
  • 谷歌云可以做网站吗vps主机上搭建网站
  • 做网站的联系方式如何做平台推广
  • 深圳专业建设网站服务织梦者网站模板
  • 政务服务网站 建设方案资兴网站建设
  • 做公益做的好的的网站网站建设600元全包