Postman use interface test tools

postman interface testing tools Introduction

About Postman:
Postman Chrome plug-in is a powerful debugging web pages and send HTTP requests.

It provides a powerful Web API & HTTP request debugging. It is possible to send any type of HTTP request (GET, HEAD, POST, PUT ..), any number of parameters included + headers.

Postman features:

  • Mainly used to simulate a network request packet
  • Quickly create request
  • Playback, management requests
  • Quick Setup Network Agent

Postman installation

1, chrome search in App Store, App Store Address: https://chrome.google.com/webstore/search/postmant=http://webstore.google . COM
over the wall download directly added into google browser plug-ins

2, client installation
https://www.getpostman.com/apps
recommend choosing Mac / Windows app, compared to Chrome app, do not need to download over the wall, more powerful

get request

Page access request (get method):

http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getWeatherbyCityName?theCityName=Los Angeles 

The interface forecasts interface returns different weather conditions by entering a different city
link Get back in the input box above, click the send button, you can obtain the corresponding return information

Request parameters modified:
the input link request above, click the Params, a value corresponding to the theCityName "Los Angeles", modify "London", click on the Send, data to return different results, as shown below:

post request

Page access request (Post Method):

http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getWeatherbyCityName

The interface forecasts interface returns different weather conditions by entering a different city
link in the input box above the back of the Post

Request parameters modified:
Enter the link above request, Body click, select x-www-form-urlencoded, a value corresponding to the theCityName "Washington", click on the Send, Washington weather forecasts can be obtained, as shown below:

form-data、x-www-form-urlencoded、raw、binary的区别

  • form-data
    is a multipart / form-data http request, it will form a message data processing is to label cells, separated by delimiters. Either upload key-value pairs, you can also upload files. When the field is uploaded file, there will be described the file Content-Type type; content-disposition, to illustrate some of the information fields; due to boundary isolated, multipart / form-data may be uploaded files may be uploaded bond value pairs, the way it uses key-value pairs, so you can upload multiple files.
  • x-www-form-urlencoded
    is application / x-www-from- urlencoded, data in the form are converted into pairs.
  • raw
    can upload any text format, you can upload text, json, xml, html and so on.
  • binary
    equivalent of Content-Type: application / octet- stream, from the literal meaning of that, you can only upload binary data, typically used to upload the file, because there is no key, so only upload one file.

multipart / form-data and x-www-form-urlencoded difference

  • multipart / form-data
    can either upload binary data such as files, you can also upload form key-value pairs, but will eventually be converted into a message.
  • x-www-form-urlencoded
    only upload key-value pairs, and key-value pairs are spaced apart.

Get and Post method difference method

  1. get is to obtain data from the server, post the data is transmitted to the server.
  2. get security is very low, post high security. But the efficiency of the Post method than good.
  3. GET POST of the security safe than others.
    Note: "Security" is not the same concept of security here and GET mentioned above. Above "safe" meaning just is not for data modification, and here the security implications are truly Security meanings, such as: submitting data via GET, user name and password in clear text appear in the URL, because (1) login page might be browser cache, (2) others to view your browser history, so others can get your account number and password, in addition, use GET to submit data also may cause Cross-site request forgery attacks.
    To sum up, Get request is sent to the server one kind of the requested data, while the Post is one kind of request submitted data to the server, in FORM (form), Method The default is "GET", essentially, GET and POST only delivery mechanism different, not a take a hair!

Guess you like

Origin www.cnblogs.com/TD1900/p/12635251.html