博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Python接口自动化--post提交的四种数据类型 4
阅读量:4654 次
发布时间:2019-06-09

本文共 834 字,大约阅读时间需要 2 分钟。

常见的post请求提交的数据类型有四种:

1.第一种:application/json:这是最常见的json格式,如下

{"input1":"XXX","input2":"ooo","remember":false}

 

2.第二种:application/x-www-form-urlencoded:浏览器的原生form表单,如果不设置enctype属性,最终会以application/x-www-form-urlencoded方式提交数据

input1=xxx&input2=ooo&remember=false

 

3.第三种:multipart/form-data:这是一种表单格式的,数据类型如下

------WebKitFormBoundaryrGKCBY7qhFd3TrwA

Content-Disposition: form-data; name="text"
title
------WebKitFormBoundaryrGKCBY7qhFd3TrwA
Content-Disposition: form-data; name="file"; filename="chrome.png"
Content-Type: image/png
PNG ... content of chrome.png ...
------WebKitFormBoundaryrGKCBY7qhFd3TrwA--

 

4.第四种:text/xml:直接传xml格式

<!--?xml version="1.0"?-->

<methodcall>
<methodname>examples.getStateName</methodname>
<params>
<param>
<value><i4>41</i4></value>
</params>
</methodcall>

 

转载于:https://www.cnblogs.com/cindy-cindy/p/8342178.html

你可能感兴趣的文章
16日彻底去除安卓应用的内置广告
查看>>
再谈.NET Micro Framework移植
查看>>
ssm资源配置
查看>>
斗鱼爬虫,爬取颜值频道的主播图片和名字
查看>>
【Codeforces Round #439 (Div. 2) B】The Eternal Immortality
查看>>
【MemSQL Start[c]UP 3.0 - Round 1 B】 Lazy Security Guard
查看>>
【codeforces 499C】Crazy Town
查看>>
【Uva 12105】Bigger is Better
查看>>
【47.40%】【codeforces 743B】Chloe and the sequence
查看>>
好用的jq复制插件clipboard.js
查看>>
linux共享库,以及/etc/ld.so.conf文件的应用【转】
查看>>
Python 爬虫(1)基础知识和简单爬虫
查看>>
[经验] Unity3D 里怎么制作天空盒(skybox)
查看>>
ViewPager和View组合 实现页面的切换
查看>>
使用PagerSlidingTabStrip实现顶部导航栏
查看>>
调用摄像头和相册
查看>>
jQuery.事件对象
查看>>
CSS之属相相关
查看>>
整理了一下自己买过的计算机书
查看>>
解决py2exe error: MSVCP90.dll: No such file or directory
查看>>