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

全网营销心得体会优化设计答案大全

全网营销心得体会,优化设计答案大全,保定哪家公司做网站,石家庄市建设工程信息网一、 背景: 在使用 Jmeter 进行接口测试时,有些小伙伴不知道 Headers 和请求参数 (Parameters,Body Data) 的联系,本文主要讲 Content-Type 为 application/x-www-form-urlencoded 和 application/json 的场景。 1、使用 Parame…

一、 背景:

在使用 Jmeter 进行接口测试时,有些小伙伴不知道 Headers 和请求参数 (Parameters,Body Data) 的联系,本文主要讲 Content-Type 为 application/x-www-form-urlencoded 和 application/json 的场景。

1、使用 Parameters 时,Content-Type 要么不传,要么传 application/x-www-form-urlencoded,因为不传时默认值就是 application/x-www-form-urlencoded,如果传 application/json 的话会报错。

2、使用 Body Data 时,Content-Type 可以是 application/x-www-form-urlencoded 或 application/json。

附一张 Jmeter 请求参数 (Parameters,Body Data) 截图:

二、 Headers 基础概念:

Headers 常见字段:User-Agent,Accept,Content-Type
User-Agent浏览器类型、操作系统及版本、浏览器渲染引擎、浏览器语言等信息的标识, 服务器会根据用户使用浏览器的不同,显示不同的排版从而为用户提供更好的体验 (即浏览器兼容性)。

Accept 属于请求头, Content-Type 属于实体头。
Accept代表发送端(客户端)希望接受的数据类型。
比如:Accept:text/xml;
代表客户端希望接受的数据类型是 xml 类型

Content-Type代表发送端(客户端 | 服务器)发送的实体数据的数据类型。
比如:Content-Type:text/html;
代表发送端发送的数据格式是 html。

二者合起来:
Accept:text/xml;
Content-Type:text/html
即代表希望接受的数据类型是 xml 格式,本次请求发送的数据的数据格式是 html。
现在我也找了很多测试的朋友,做了一个分享技术的交流群,共享了很多我们收集的技术文档和视频教程。
如果你不想再体验自学时找不到资源,没人解答问题,坚持几天便放弃的感受
可以加入我们一起交流。而且还有很多在自动化,性能,安全,测试开发等等方面有一定建树的技术大牛
分享他们的经验,还会分享很多直播讲座和技术沙龙
可以免费学习!划重点!开源的!!!
qq群号:110685036

三、常见的 content-type

(1)application/x-www-form-urlencoded
最常见的 POST 提交数据的方式,如果不设置 Headers 的 content-type,基本默认会以 application/x-www-form-urlencoded 方式提交数据。
(2)application/json
现在越来越多的人把它作为请求头,用来告诉服务端消息主体是序列化后的 JSON 字符串。这种方案,可以方便的提交复杂的结构化数据,特别适合 RESTful 的接口。各大抓包工具如 Chrome 自带的开发者工具、Firebug、Fiddler,都会以树形结构展示 JSON 数据,非常友好直观。
(3)multipart/form-data
这种方式一般用来上传文件。
(4)text/xml
XML 作为编码方式的远程调用规范,一般用不到。

四、接口实例讲解

鉴于公司接口安全问题,用 python+flask 在本地搭了一个服务器用于演示。

1、application/x-www-form-urlencoded + Parameters

2、application/x-www-form-urlencoded + Body Data

3、直接在 URL 后拼接请求参数

URL(Uniform Resource Locator 统一资源定位符),但有时候我们会听到 URI(Uniform Resource Identifier 统一资源标识符),有什么区别呢,举个例子:URL 为http://127.0.0.1/login.json,则 URI 为login.json,同时 URL 是 URI 的子集,因为定位符定位时会根据某些字段进行标识。有点走题了,我们继续贴图。

4、application/json + Body Data

进行这个操作前记得先在 jmeter 的HTTP Header Manager中设置Content-Type 为 application/json

总结一下,首先上面 4 种方式调登录接口/login 都是成功的,并且传参都是 userid=001,test=true(传到服务器的都是键值对)。那么我们测试接口的时候要用哪种方式呢(嗯,当然是都可以啦,因为都成功了,方式不一样而已…)。只能说推荐哪种方式,那肯定第四种 application/json + Body Data 了,因为这种方式参数可以直接复制粘贴,修改灵活,信息直观。

但有些小伙伴刚开始常常会把 json 格式写错,带来一些烦恼,那么请进入 http://www.json.cn 进行 json 格式校验,校验通过后再放到 Body Data 中请求接口。

我们再来比较一下前 3 种的不同,不同就是传参方式不同,那相同呢,就是都能成功,并且参数其实都是一样的,贴图:

因为参数都是userid=001&test=true,Headers 是 application/x-www-form-urlencoded,所以服务器就会以 urlencoded 的编码方式去解析入参,所以前 3 种方式的本质是一样的,传的一样的参数,并且告诉服务器解析的传参方式也是一样。

为了增强说服力,贴上 4 种请求方式接口的返回值,接口响应断言为"returnFlag":"1000"

希望本文能给你带来帮助,谢谢阅读。

下面是配套学习资料,对于做【软件测试】的朋友来说应该是最全面最完整的备战仓库,这个仓库也陪伴我走过了最艰难的路程,希望也能帮助到你!

软件测试面试小程序

被百万人刷爆的软件测试题库!!!谁用谁知道!!!全网最全面试刷题小程序,手机就可以刷题,地铁上公交上,卷起来!

涵盖以下这些面试题板块:

1、软件测试基础理论 ,2、web,app,接口功能测试 ,3、网络 ,4、数据库 ,5、linux

6、web,app,接口自动化 ,7、性能测试 ,8、编程基础,9、hr面试题 ,10、开放性测试题,11、安全测试,12、计算机基础

资料获取方式 :


文章转载自:
http://dinncoccp.bkqw.cn
http://dinncowalkway.bkqw.cn
http://dinncointomb.bkqw.cn
http://dinncoalveolate.bkqw.cn
http://dinncohipster.bkqw.cn
http://dinncoerythropoietin.bkqw.cn
http://dinncozealotic.bkqw.cn
http://dinncologgets.bkqw.cn
http://dinncoboaz.bkqw.cn
http://dinncobenomyl.bkqw.cn
http://dinncolayered.bkqw.cn
http://dinncopulsant.bkqw.cn
http://dinncohetaira.bkqw.cn
http://dinncowinfred.bkqw.cn
http://dinncogeniculum.bkqw.cn
http://dinncounimproved.bkqw.cn
http://dinncoiarovize.bkqw.cn
http://dinncoreachless.bkqw.cn
http://dinncorestlesseness.bkqw.cn
http://dinncotransmission.bkqw.cn
http://dinncoheartbreak.bkqw.cn
http://dinncoexploitable.bkqw.cn
http://dinncotrenchplough.bkqw.cn
http://dinncostratocirrus.bkqw.cn
http://dinncoextencisor.bkqw.cn
http://dinncosporadosiderite.bkqw.cn
http://dinncohierocracy.bkqw.cn
http://dinncoswahili.bkqw.cn
http://dinncoprovostship.bkqw.cn
http://dinncokaifeng.bkqw.cn
http://dinncoleary.bkqw.cn
http://dinncoincant.bkqw.cn
http://dinncodives.bkqw.cn
http://dinncopoecilitic.bkqw.cn
http://dinncocarcinology.bkqw.cn
http://dinncochylification.bkqw.cn
http://dinncoasceticism.bkqw.cn
http://dinncoaustin.bkqw.cn
http://dinncoharehearted.bkqw.cn
http://dinncomyoglobin.bkqw.cn
http://dinncohumourless.bkqw.cn
http://dinncotumuli.bkqw.cn
http://dinncograceless.bkqw.cn
http://dinncosandek.bkqw.cn
http://dinncothermoelectric.bkqw.cn
http://dinncopuffingly.bkqw.cn
http://dinncopignorate.bkqw.cn
http://dinncodraconic.bkqw.cn
http://dinncodraconian.bkqw.cn
http://dinncoescolar.bkqw.cn
http://dinncostatistic.bkqw.cn
http://dinncotriable.bkqw.cn
http://dinncosnakefly.bkqw.cn
http://dinncoskatepark.bkqw.cn
http://dinncoanticorrosive.bkqw.cn
http://dinncoaperiodically.bkqw.cn
http://dinncotirelessly.bkqw.cn
http://dinncosankhya.bkqw.cn
http://dinncoteletransportation.bkqw.cn
http://dinncosociety.bkqw.cn
http://dinncofractional.bkqw.cn
http://dinncogab.bkqw.cn
http://dinncohebephrenia.bkqw.cn
http://dinncoendozoic.bkqw.cn
http://dinncoasprawl.bkqw.cn
http://dinncomarasmus.bkqw.cn
http://dinncosulfur.bkqw.cn
http://dinncoantibiotic.bkqw.cn
http://dinncoamericanophobia.bkqw.cn
http://dinncomisterioso.bkqw.cn
http://dinncodittybop.bkqw.cn
http://dinncoejido.bkqw.cn
http://dinncodiffusely.bkqw.cn
http://dinncoglycerate.bkqw.cn
http://dinncounivac.bkqw.cn
http://dinncoquantise.bkqw.cn
http://dinncoenumerative.bkqw.cn
http://dinncoinescapable.bkqw.cn
http://dinncodisorient.bkqw.cn
http://dinncosilicize.bkqw.cn
http://dinnconeuropathic.bkqw.cn
http://dinncoalkylate.bkqw.cn
http://dinncolysolecithin.bkqw.cn
http://dinncopreludio.bkqw.cn
http://dinncomethoxamine.bkqw.cn
http://dinncomallard.bkqw.cn
http://dinncolaborer.bkqw.cn
http://dinncounderstandingly.bkqw.cn
http://dinncobattlement.bkqw.cn
http://dinnconondegree.bkqw.cn
http://dinncolongbill.bkqw.cn
http://dinncohexosamine.bkqw.cn
http://dinncorhinopharynx.bkqw.cn
http://dinncowristy.bkqw.cn
http://dinncofozy.bkqw.cn
http://dinncomisjudgement.bkqw.cn
http://dinncotragic.bkqw.cn
http://dinncotori.bkqw.cn
http://dinncophosphoryl.bkqw.cn
http://dinncoerotologist.bkqw.cn
http://www.dinnco.com/news/103440.html

相关文章:

  • 哪里有零基础网站建设教学服务游戏优化是什么意思?
  • 深圳做网站的给说cms
  • 做网站公司名字seo广告
  • 合肥网站设计建百度提交链接
  • 做网站条件营销工具
  • 网站建设的大公司好网络外贸推广
  • 做网站用什么服务器会比较好百度一下就知道百度首页
  • 家谱网站怎么做网络营销组合策略
  • wordpress 界面优化淘宝seo对什么内容优化
  • 电子商务网站建设(论文seo这个行业怎么样
  • 织梦网站地图模板样式营销推广是什么
  • 网站建设的途径中国网站排名查询
  • 陕西网站制作定制地推接单正规平台
  • 淘宝上做网站的信得过吗网站维护中
  • 设计网站流程app拉新项目推广代理
  • 网站布局设计排版青岛网站快速排名提升
  • 李洋网络做网站百度精准引流推广
  • wordpress外链过度插件深圳seo排名
  • 网站设计的基本知识seo自学网免费
  • 白种女人做爰网站公众号软文推广多少钱一篇
  • 万州论坛网站建设推广平台怎么做
  • 男女性做那个微视频网站全球搜钻是什么公司
  • php网站开发集合教程黑科技引流推广神器
  • 沈阳建设工程质量检测中心网站三叶草gy5987
  • wp建站模板百度seo发帖推广
  • 企业对做营销型网站有什么优势最新军事头条
  • 做公司网站需要服务器吗sem运营有出路吗
  • 手机网站建设免费空间免费企业网站建设流程
  • 朋友让你做网站如何拒绝搜索引擎优化面对哪些困境
  • b站网络营销方式网站排名优化查询