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

post插件

分享牛系列,分享牛专栏,分享牛。在项目开发中,http请求方式是最常见的了。怎么模拟http请求呢?方法有很多种,可以使用httpclient直接模拟请求,也可以使用火狐post插件方式,这个章节主要讲解火狐post插件使用。

首先下载火狐浏览器,直接在下载,附加组件中添加poster即可,附加之后效果如下所示:

 

点击打开即可。看到这个图片表示安装成功了。

下面开始操作:

1.1. get

get方式比较简单,直接在请求中添加?&之类的参数即可。

比如http://127.0.0.1:8080/matrix-deploy/groupuser/get_studio_user_list2?gid=590594

直接在请求中选择get方式即可,或者在参数中添加如下所示:

 

返回的格式如下:

{
    "apistatus": 1,
    "result": {
        "total": 15,
        "liveStatus": false,
        "onmic": [],
        "users": [
            {
                "birthday": "2013-01-01",
                "nickname": "陈陈陈陈_",
                "user_type": 1,
                "subtag_info": {
                    "subtag_name": "房主",
                    "subtag_gid": 0,
                    "can_show": true
                },
                "avatar": "18130909",
                "id": "109084",
                "jointime": "Wed Jun 08 11:44:33 +0800 2016",
                "description": "",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 11:44:33 +0800 2016",
                "gender": "f",
                "role": 4,
                "isGag": false
            },
            {
                "birthday": "1985-01-01",
                "nickname": "爱扶老奶奶的蜀黍",
                "user_type": 1,
                "subtag_info": {
                    "subtag_name": "管理员",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "avatar": "88451951",
                "id": "42750",
                "jointime": "Wed Jun 08 11:49:49 +0800 2016",
                "description": "当芳芳遇到阿德丽娜",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 19:11:21 +0800 2016",
                "gender": "m",
                "role": 3,
                "isGag": false
            },
            {
                "id": "10121",
                "birthday": "1990-05-31",
                "jointime": "Wed Jun 08 14:23:05 +0800 2016",
                "user_type": 1,
                "nickname": "NEXI",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 14:23:05 +0800 2016",
                "subtag_info": {
                    "subtag_name": "管理员",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "role": 3,
                "gender": "m",
                "avatar": "97547862",
                "isGag": false
            },
            {
                "id": "40505",
                "jointime": "Wed Jun 08 18:27:23 +0800 2016",
                "user_type": 1,
                "nickname": "�",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 18:27:23 +0800 2016",
                "subtag_info": {
                    "subtag_name": "管理员",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "role": 3,
                "gender": "m",
                "avatar": "89053902",
                "isGag": false
            },
            {
                "id": "40452",
                "birthday": "1990-01-01",
                "jointime": "Wed Jun 08 16:41:24 +0800 2016",
                "user_type": 1,
                "nickname": "Ddddd",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 16:41:24 +0800 2016",
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "role": 1,
                "gender": "f",
                "avatar": "89657268",
                "isGag": false
            },
            {
                "birthday": "1985-01-01",
                "nickname": "自我喔喔喔喔喔喔喔喔喔喔自我喔",
                "user_type": 1,
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "avatar": "88792220",
                "id": "381531",
                "jointime": "Wed Jun 08 18:58:38 +0800 2016",
                "description": "",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 18:58:38 +0800 2016",
                "gender": "f",
                "role": 1,
                "isGag": false
            },
            {
                "id": "40561",
                "jointime": "Wed Jun 08 18:59:29 +0800 2016",
                "user_type": 1,
                "nickname": "少吃一口舒服一宿",
                "description": "",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 19:08:56 +0800 2016",
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "role": 1,
                "gender": "m",
                "avatar": "90023585",
                "isGag": false
            },
            {
                "id": "41340",
                "birthday": "1992-01-01",
                "jointime": "Wed Jun 08 14:36:01 +0800 2016",
                "user_type": 1,
                "nickname": "吉吉小王",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 14:36:01 +0800 2016",
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "role": 1,
                "gender": "f",
                "avatar": "89984476",
                "isGag": false
            },
            {
                "birthday": "1985-01-01",
                "nickname": "v",
                "user_type": 1,
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "avatar": "88970314",
                "id": "396861",
                "jointime": "Wed Jun 08 15:38:13 +0800 2016",
                "description": "",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 19:09:34 +0800 2016",
                "gender": "m",
                "role": 1,
                "isGag": false
            },
            {
                "id": "381317",
                "birthday": "1969-01-01",
                "jointime": "Wed Jun 08 18:45:15 +0800 2016",
                "user_type": 1,
                "nickname": "2goz",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 19:05:46 +0800 2016",
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "role": 1,
                "gender": "m",
                "avatar": "89985176",
                "isGag": false
            },
            {
                "id": "42459",
                "jointime": "Wed Jun 08 19:21:20 +0800 2016",
                "user_type": 1,
                "nickname": "疯子",
                "description": "",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 19:21:20 +0800 2016",
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "role": 1,
                "gender": "m",
                "avatar": "89474976",
                "isGag": false
            },
            {
                "id": "41436",
                "jointime": "Wed Jun 08 19:10:25 +0800 2016",
                "user_type": 1,
                "nickname": "11",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 19:10:25 +0800 2016",
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "role": 1,
                "gender": "f",
                "isGag": false
            },
            {
                "birthday": "2006-04-05",
                "nickname": "冀正",
                "user_type": 1,
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "avatar": "89985536",
                "id": "398402",
                "jointime": "Wed Jun 08 13:27:52 +0800 2016",
                "description": "",
                "onAir": 0,
                "groupuser_props": {
                    "isFocus": 2,
                    "gag": false,
                    "show_mark": true,
                    "attention": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 13:27:52 +0800 2016",
                "gender": "m",
                "role": 1,
                "isGag": false
            },
            {
                "id": "41707",
                "jointime": "Wed Jun 08 18:46:37 +0800 2016",
                "user_type": 1,
                "nickname": "8块腹肌",
                "description": "",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 18:46:37 +0800 2016",
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "role": 1,
                "gender": "m",
                "avatar": "90023308",
                "isGag": false
            },
            {
                "id": "41506",
                "jointime": "Wed Jun 08 15:37:06 +0800 2016",
                "user_type": 1,
                "nickname": "嘉熙",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 15:37:06 +0800 2016",
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "role": 1,
                "gender": "m",
                "isGag": false
            },
            {
                "id": "42624",
                "birthday": "1990-01-01",
                "jointime": "Wed Jun 08 14:26:10 +0800 2016",
                "user_type": 1,
                "nickname": "吉吉大王",
                "onAir": 0,
                "groupuser_props": {
                    "show_mark": true,
                    "remind": "UnDisturb"
                },
                "activetime": "Wed Jun 08 14:26:10 +0800 2016",
                "subtag_info": {
                    "subtag_name": "未分组",
                    "subtag_gid": 0,
                    "can_show": false
                },
                "role": 1,
                "gender": "f",
                "avatar": "90019043",
                "isGag": false
            }
        ],
        "queues": []
    }
}


1.2. post方式

post方式比较费时,我们在选择的时候选择post方式。

 

注意Content-Type一定要选择对,否则会不正确的。

具体值得传递跟get一样?gid=590594

 

具体如下所示:

 

1.3. header添加

很多请求的时候,可能涉及到回话或者其他的东西,需要header支持,在这里就必须要使用添加header方式了,

具体的添加如下:

 

分享牛系列,分享牛专栏,分享牛。 分享牛原创(尊重原创 转载对的时候第一行请注明,转载出处来自分享牛http://blog.csdn.net/qq_30739519) Java架构师交流群 523988350

相关文章:

  • 改变从内部开始:开发者与管理者的协作
  • Struts2入门示例
  • [Java] 图说 注解
  • [一句秒懂]拦截iOS系统导航栏返回按钮事件-三种方法
  • mysql常用基础操作语法(三)~~对数据的增删改操作【命令行模式】
  • IIS性能计数器说明
  • 录音,录制视频,权限问题
  • vue中实现单选
  • CDM2.04.06 WHQL Certified
  • centos xargs
  • python 程序列表
  • CISA 信息系统审计知识点 [第二章. IT治理和管理 ]
  • 让标签横向滑动 盒模型
  • 编程基础-----c语言打印调用栈
  • xcache为php加速
  • [LeetCode] Wiggle Sort
  • C语言笔记(第一章:C语言编程)
  • exports和module.exports
  • LeetCode算法系列_0891_子序列宽度之和
  • Nacos系列:Nacos的Java SDK使用
  • node-sass 安装卡在 node scripts/install.js 解决办法
  • SegmentFault 社区上线小程序开发频道,助力小程序开发者生态
  • vue 个人积累(使用工具,组件)
  • 仿天猫超市收藏抛物线动画工具库
  • 湖南卫视:中国白领因网络偷菜成当代最寂寞的人?
  • 检测对象或数组
  • 首页查询功能的一次实现过程
  • 学习笔记TF060:图像语音结合,看图说话
  • 转载:[译] 内容加速黑科技趣谈
  • Play Store发现SimBad恶意软件,1.5亿Android用户成受害者 ...
  • 容器镜像
  • ​LeetCode解法汇总2696. 删除子串后的字符串最小长度
  • ​插件化DPI在商用WIFI中的价值
  • ​软考-高级-系统架构设计师教程(清华第2版)【第1章-绪论-思维导图】​
  • ###51单片机学习(1)-----单片机烧录软件的使用,以及如何建立一个工程项目
  • ###C语言程序设计-----C语言学习(3)#
  • #etcd#安装时出错
  • #if 1...#endif
  • #QT(智能家居界面-界面切换)
  • #在 README.md 中生成项目目录结构
  • $forceUpdate()函数
  • (03)光刻——半导体电路的绘制
  • (175)FPGA门控时钟技术
  • (3)(3.5) 遥测无线电区域条例
  • (39)STM32——FLASH闪存
  • (二)Linux——Linux常用指令
  • (二)基于wpr_simulation 的Ros机器人运动控制,gazebo仿真
  • (机器学习的矩阵)(向量、矩阵与多元线性回归)
  • (论文阅读40-45)图像描述1
  • (转)程序员技术练级攻略
  • 、写入Shellcode到注册表上线
  • .bat批处理(六):替换字符串中匹配的子串
  • .NET Compact Framework 多线程环境下的UI异步刷新
  • .net core 6 redis操作类
  • .net core webapi 部署iis_一键部署VS插件:让.NET开发者更幸福