分享
分销 收藏 举报 申诉 / 22
播放页_导航下方通栏广告

类型Postman使用基础手册.doc

  • 上传人:快乐****生活
  • 文档编号:3032328
  • 上传时间:2024-06-13
  • 格式:DOC
  • 页数:22
  • 大小:1.42MB
  • 下载积分:10 金币
  • 播放页_非在线预览资源立即下载上方广告
    配套讲稿:

    如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

    特殊限制:

    部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

    关 键  词:
    Postman 使用 基础 手册
    资源描述:
    Postman使用手册 Sending requests--发送请求 The Postman interface is divided into two areas. The sidebar on the left and the request builder on the right. The request builder lets you create almost any kind of request quickly. The four parts of an HTTP request are the URL, method, headers, and the body. Postman gives you tools to work with each of these parts. Postman界面分为两个区域。侧边栏左边和右边请求builder。请求构建器许可您创建几乎任何类型请求很快。四个部分一个HTTP请求URL,方法,头,身体。Postman给你工具来处理这些部分。 URL The URL is the first thing that you would be setting for a request. The URL input field stores URLs used previously and will show an auto complete dropdown as you begin entering your URL. Clicking on the URL params button will open up the key-value editor for entering URL parameters. URL第一件事,你会设置请求。先前使用URL输入字段存放URL并将显示自动完成下拉当你开始进入你网址。单击URL参数按钮将打开键-值编辑器输入URL参数 Parameters you enter in the URL bar or in the key/value editor will not automatically be URL-encoded. Right click on a piece of selected text, and click EncodeURIComponent to manually encode the parameter value. 参数输入地址栏或键/值编辑器不会自动URL编码。右击选中文本,然后单击EncodeURIComponent手工编码参数值。 You can individually add key/value pairs and Postman will combine everything together. If your URL already has parameters - for example, if you are pasting a URL from some other source, Postman will split the URL into pairs automatically. 您能够单独添加键/值对,postman会结合在一起一切。假如你URL已经参数——比如,假如你是粘贴URL从其它起源,postman将URL分成自动配对 Headers Clicking on the headers toggle will show the headers key-value editor. You can set any string as the header name. Common headers part of the HTTP spec are available in an auto-complete drop down when you begin typing the header name. Values for the "Content-Type" header are also available in an auto-complete drop down. 单击标题切换键值编辑器将显示头。你能够设置任何字符串作为标题名称。常见HTTP标头部分规范在一个自动完成拉当你开始键入标题名称。“内容类型”头值也能够自动完成下拉。 Header presets You can save commonly used headers together in a header preset. You can add a header preset to your request by clicking the "Add preset" button or by selecting the preset from the header dropdown. 您能够保留常见标题在标题预设。您能够添加一个头预定你请求经过单击“添加预设”按钮或经过选择预设标题下拉 Method Changing the method is straightforward. Just select the method from the select control. The request body editor area will change depending on whether the method can have a body attached to it or not. 改变方法很简单。只是选择方法从请求主体选择控制。编辑器区域将会改变取决于方法能够有身体连接到它。 The ability to add additional methods and toggling whether a body can be attached to it will be added soon 添加额外方法和切换能力是否身体能够被附加到它很快就会被添加 Request body While constructing requests, you would be dealing with the request body editor a lot. Postman let's you send almost any kind of HTTP request (If you can't send something, let us know!). The body editor is divided into 4 areas and has different controls depending on the body type. 而构建请求,您将处理请求主体编辑器。postman让你送几乎任何类型HTTP请求(假如你不能送东西,让我们知道!)。身体编辑分为4个区域,依据身体类型有不一样控制。 form-data multipart/form-data is the default encoding a web form uses to transfer data. This simulates filling a form on a website, and submitting it. The form-data editor lets you set key/value pairs (using the key-value editor) for your data. You can attach files to a key as well. Do note that due to restrictions of the HTML5 spec, files are not stored in history or collections. You would have to select the file again at the time of sending a request. 多部分/格式数据是默认编码一个web表单使用传输数据。这对一个网站模拟填充表单,并提交它。格式数据编辑器许可您设置键/值对(使用键值编辑器)为您数据,您能够将文件附加到一个关键。做注意,因为HTML5规范限制,文件不存放在历史或集合。你会选择文件再次发送请求时候。 urlencoded This encoding is the same as the one used in URL parameters. You just need to enter key/value pairs and Postman will encode the keys and values properly. Note that you can not upload files through this encoding mode. There might be some confusion between form-data and urlencoded so make sure to check with your API first. 这个编码是一样使用URL参数。你只需要输入键/值对,postman将编码键和值正常。请注意,您不能上传文件经过这个编码模式。可能会有部分混淆格式数据和urlencoded所以一定先检验你API。 raw A raw request can contain anything. Postman doesn't touch the string entered in the raw editor except replacing environment variables. Whatever you put in the text area gets sent with the request. The raw editor lets you set the formatting type along with the correct header that you should send with the raw body. You can set the Content-Type header manually as well. Normally, you would be sending XML or JSON data here. 原始请求能够包含任何东西。postman不碰在原始编辑器中输入字符串替换环境变量除外。不管你文本区域发送请求。原始编辑器许可您设置格式类型和正确标题,你应该发送原始身体。你也能够手动设置content - type头。通常,你会在这里发送XML或JSON数据。 binary binary data allows you to send things which you can not enter in Postman. For example, image, audio or video files. You can send text files as well. As mentioned earlier in the form-data section, you would have to reattach a file if you are loading a request through the history or the collection. 二进制数据许可你发送东西你不能进入postman。比如,图像,音频或视频文件。您能够发送文本文件格式数据节。正如前面提到,你必需将一个文件加载请求经过历史或集合。 Working with responses Ensuring that the API response is correct is something that you will be doing a lot. The Postman response viewer will make this task much easier for you. 确保API反应是正确,你会做很多。postman响应查看器将使这项任务变得更简单。 An API response consists of the body, headers and the status code. Postman organizes body and headers in different tabs. The status code with the time taken for the API call is displayed next to the tabs. You can hover over the status code to get more details about the code. Mostly it will be the default description as mandated by the HTTP spec but API authors can also add custom messages. API反应包含身体、头和状态码。postman组织体在不一样标签和标题。时间状态代码旁边API调用显示选项卡。你能够悬停在状态代码更具体代码。关键是它将默认API描述HTTP规范强制要求,但作者也能够添加自定义消息。 Saving responses If a request has been saved in a collection, you can save responses for that request. Once the response has been received, click the "Save response" button. You'll be able to save the response with a name. All responses saved for a request will be available whenever you load the request (above the request URL). 假如请求被保留在一个集合,您能够保留响应请求。只有在接收到响应后,单击“保留响应”按钮。你能够保留响应和一个名字。全部响应保留请求能够不管何时加载请求(在请求URL)。 Viewing responses---查看回复 The Postman body tab gives you several tools to help you make sense of things quickly. The body can be viewed in one of three views - pretty, raw, and preview. postman身体标签给你部分工具来帮助您了解事情很快。身体能够在三种见解——漂亮,生和预览 Pretty The pretty mode formats JSON or XML responses so that they are easier to look at. Nobody wants to scroll through a minified single line JSON response looking for that elusive string! Links inside the pretty mode are highlighted and clicking on them can load a GET request in Postman with the link URL. By clicking on the line numbers on the left you can fold large chunks of the response. For Postman to automatically format the body, make sure the appropriate Content-Type header is returned. If the API does not do this then you can force formatting through JSON or XML. You can enable the "Force JSON" setting as well. 漂亮模式格式JSON或XML响应,这么她们更轻易看。没人想滚动一个缩小单线JSON响应寻求难以捉摸字符串!突出漂亮模式中链接,点击能够加载一个GET请求postman链接URL。经过点击左边行号你能够折叠大量响应。postman自动格式,确保合适内容类型返回头。假如API不这么做,那么你能够迫使经过JSON或XML格式。您能够启用“JSON力量”设置。 Note: You can use Cmd+F / Ctrl+F to open the search bar, and Cmd+G / Ctrl+G to scroll through results. 注意:您能够使用Cmd + F / Ctrl + F打开搜索栏,和Cmd + G / Ctrl + G滚动结果。 Raw The raw view is just a big text area with the response body. It can help to tell whether your response is minified or not. 原始见解只是一个大文本区域响应身体。它能够帮助你判定反应是否缩小。 Preview The preview tab renders the response in a sandboxed iframe. Some web frameworks by default return HTML errors and the preview mode is especially helpful there. Due to iframe sandbox restrictions, Javascript and images are disabled in the iframe. preview选项卡展现响应在沙箱iframe。部分web框架默认返回HTML错误和preview模式尤其有帮助。因为iframe沙箱限制,Javascript和iframe图像被禁用。 You can maximize the body to occupy the whole Postman window. In case, you plan on spending a lot of time with the response, this is the way to go. 你能够最大化身体占据整个postman窗口。在情况下,你计划花费了大量时间和响应,这是路要走。 If your API endpoint returns an image, Postman will detect and render it automatically. For binary response types, you should select "Send and download" which will let you save the response to your hard disk. You can then view it using the appropriate viewer. This gives you the flexibility to test audio files, PDFs, zip files or anything that the API throws at you. 假如你API端点返回一个形象,postman将自动检测并展现它。对于二进制响应类型,你应该选择“发送和下载”,会让你节省硬盘响应。然后你能够查看它使用合适观众。这使您灵活性来测试音频文件,pdf,zip文件或任何API抛给你。 Headers Headers are displayed as key/value pairs in the header tab. Hovering over the header name can give you a description of the header according to the HTTP spec. If you are sending a HEAD request, Postman will show the headers tab by default. 标题显示键/值对标题标签。徘徊在标题名称能够给你描述标题依据HTTP规范。假如你发送HEAD请求,postman将显示默认标题标签。 Basic Auth Enter the username and password fields and hit "Refresh headers" to generate the authorization header. 输入用户名和密码字段,并点击“刷新头”生成授权头。 Digest Auth Digest auth is more complicated than basic auth and uses the values currently set in the request to generate the authorization header. Make sure they are set properly before you generate the header. Postman will remove the existing header if it's already present. 消化身份验证是更复杂比基础认证和使用请求中值现在设置生成授权头。确保她们正确设置之前生成标题。postman会删除现有头假如它已经存在。 OAuth 1.0a Postman's OAuth helper let's you sign requests which support OAuth 1.0a based authentication. Currently it does not let you acquire the access token. That's something you would need from the API provider. The OAuth 1.0 helper can set values in either the header or as query parameters. PostmanOAuth助手让你签署请求支持OAuth 1.0基础认证。现在它不让你获取访问令牌。这是需要从API提供者。OAuth 1.0助手能够在标题或设置值作为查询参数。 As subsequent OAuth requests might expect a different nonce value, Postman can refresh the OAuth signature just before the request is sent if auto add parameters is enabled. 后续OAuth请求可能认为不一样nonce价值,postman能够刷新OAuth署名发送请求之前假如启用了自动添加参数。 The OAuth 1.0 spec is quite complicated and there are many variations. Postman tries to support as many of those variations as possible but if something does not work for you, please file an issue on Github. These are few of the options that we've included: OAuth 1.0规范很复杂,有很多改变。postman试图支持尽可能多这些改变,但假如不为你工作,请在Github文件问题。这些全部是部分我们选项包含: · Add empty params to signature - Some implementations of OAuth1.0 require empty parameters to be added to the signature.加空参数署名,有些实现OAuth1.0需要添加到空参数署名。 · Add params to header - If this is enabled, params are added to the header. If not - the URL params for a GET request, and the request body for POST/PUT requests参数添加到标题——假如这是启用,参数被添加到标题。假如不是——一个GET请求URL参数,和POST或PUT请求请求主体 OAuth 2.0 Postman supports getting the OAuth 2.0 token as well as adding it to requests really easy. To get an access token from an OAuth 2.0 provider, follow these steps: · Set · Get authorization URL, access token URL, client ID and client secret from your API provider. You can also set the Scope parameter which is needed by some APIs to set the level of access you have within the API · Press the "Get access token" button to initate the OAuth 2.0 flow. If everything is set up properly, you would be redirected to the Postman server which will pick up your access token and send it to the Postman app. To finish adding the token to Postman, give it a name so that you can access it quickly later. · Access tokens are stored locally and will show up in the helper list. To add an access token to the request, click the token name. Operations on folders/requests Editing Hover over the folder/request name in the sidebar, and click the edit (pencil) icon. This will allow you to change the name and description. Note that the description supports Markdown. Duplicating Duplicating will create a copy of the folder/request. The new folder/request will be created as a sibling of the original. Deleting Note: Deleting a folder will delete its constituent requests, and deleting a request will delete any responses saved with the request. Sharing collections Starting with Postman v0.9.3 you have the ability to share and manage your collections more effectively. The first thing you will have to do is create a Postman account. You can create one using your email ID or a 谷歌 account. Once you are signed in after creating an account, the collections you upload on Postman are linked to your account. You can delete them later through the "Shared collections" item in the navigation bar dropdown. 从postmanv0.9.3你有能力分享并更有效地管理你集合。你要做第一件事是创建一个postman账户。您能够创建一个使用你电子邮件ID或一个谷歌帐户。一旦你在创建一个帐户后,签署您上传集合postman全部和您帐户。稍后您能够删除它们经过导航栏中“共享收藏”项下拉。 The shared collections modal also let's you upload all of your local collections with one click. If you just installed Postman on a new machine, then you can download all your collections too. 共享集合模态也让你上传全部地方和一个点击收藏。假如你只是postman在新机器上安装,然后你也能够下载你全部集合。 Shared collections are private unless explicitly labelled public. You can download or delete individual collections too. 共享集合是私有,除非显式标签。你也能够下载或删除个人收藏。 API Directory The Postman API directory gives you access to public collections shared by the Postman community. These are still early days for the directory but the goal is to have commonly used APIs available here. Developers should be able to get started quickly without having to recreate requests through the API documentation or curl docs. postmanAPI目录给你访问公共集合由postman共享小区。这些仍在早期目录,但目标是常见API。开发人员应该能够开始快速而无需重新创建请求经过API文档或文档旋度。 This feature is currently available only in v0.9.x Environments While working with APIs, you will often need to have different setups. For example, your local machine, the development server, or the production API. Environments give you the ability to customize requests using variables. This way you can easily switch between different setups without changing your requests. You won't have to worry about remembering all those values once they are in Postman. Environments can be downloaded and saved as JSON files and uploaded later. 使用API时,您通常会需要不一样设置,比如,你当地机器,开发服务器,或生产API。环境使您能够定制请求使用变量。这么你能够很轻易地切换不一样设置没有改变你请求。你无须担心记住全部这些值一旦postman。环境中能够下载并保留为JSON文件,稍后上传。 Each environment is a set of key-value pairs. These can be edited using the key-value editor. They key is the variable name. 每个环境是一组键值对。这些能够使用键值编辑器编辑。关键是变量名。 Variables can be used in the following form - {{variableName}}. The string {{variableName}} will be replaced with its corresponding value. For example, for an environment variable 'url' with the value 'http://localhost' , you will have to use {{url}} in the request URL field. {{url}} will be replaced by http://localhost when the request is sent. 变量能够用在以下表格——{ { variableName } }。{ { variableName } }字符串将被替换为对应值。比如,在一个环境变量url值“http://localhost”,你将不得不使用{ { url } }在请求url字段。{ { url } }将取而代之是http://localhost当请求被发送。 Only variables from the currently selected environment will be available to you. Use the environment selector to select an environment: 仅从目前选择环境变量将提供给你。使用环境选择器选择一个环境: Key-value Editor The Key-Value Editor is a UI element that is used ac
    展开阅读全文
    提示  咨信网温馨提示:
    1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
    2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
    3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
    4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
    5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
    6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

    开通VIP折扣优惠下载文档

    自信AI创作助手
    关于本文
    本文标题:Postman使用基础手册.doc
    链接地址:https://www.zixin.com.cn/doc/3032328.html
    页脚通栏广告

    Copyright ©2010-2026   All Rights Reserved  宁波自信网络信息技术有限公司 版权所有   |  客服电话:0574-28810668    微信客服:咨信网客服    投诉电话:18658249818   

    违法和不良信息举报邮箱:help@zixin.com.cn    文档合作和网站合作邮箱:fuwu@zixin.com.cn    意见反馈和侵权处理邮箱:1219186828@qq.com   | 证照中心

    12321jubao.png12321网络举报中心 电话:010-12321  jubao.png中国互联网举报中心 电话:12377   gongan.png浙公网安备33021202000488号  icp.png浙ICP备2021020529号-1 浙B2-20240490   


    关注我们 :微信公众号  抖音  微博  LOFTER               

    自信网络  |  ZixinNetwork