On the basic interface test and postman use

What is the interface:

       Briefly, the interface is used to connect the client and server stuff generally used JSON format to transmit data, as to avoid various problems arising due to the different programming languages when transmitting data. Of course, there is also an XML format Transmission.

  It mainly includes the following aspects:

  • Address (the URL of) : With the address we can access (call) specified (to be tested) methods (functions), etc.
  • Request parameters : Depending on business requirements, different functions need to vary the parameters of the request parameter contains the necessary parameters and non-essential parameters, under normal circumstances we can only focus on the necessary parameters, but for different business scenarios or types of demand, but also consider back-office services for non-essential process parameters, and (form) for a list of data, like a field containing the handling of multiple records
  • Request method : is the use of get request or post request it, need to refer to the interface documentation , or direct communication and development
  • Return messages : general test is specific functions background service side, such as registration, login, CRUD, the main concern parameters and parameter returns worth meanings for different project requirements, there needs to be an interface for input and output results check the alignment, such as data related to the pass-through function in large systems like switching module

Interface Test:

    In simple terms, set aside the interface test is a functional test interface (UI), the UI does not need attention, direct call interface url, input parameter values, submit, receive a return message; also part of the system (non-client) no UI, set aside full link testing, it can only be tested by means of the call interface, such as switching modules, etc.

       Interface test commonly used post get request or requests by:

  • GET:? Url parameter passed directly spliced, splicing way URL + + + parameter name parameter value = (& parameter parameter name = value) .... Depending on the parameters required, the use of & splicing between parameters

   For chestnut:   http://api.xxxx.cn/xxx/xxx/xxx?username=test&password=123456   

   注:get请求是可以在浏览器-地址栏中直接发送的

  • POST: need to use tools to initiate, such as Postman

  

POSTMAN basic use:

The basic post request:  

  After the first login on a bar chart

  

  • Select the POST request method behind the address bar entry you want to call URL

   

  • Input parameters we can choose to body - formdata be entered, which represents the key parameter name value representative of the parameter values

   

   There will be an interface type specified parameters, such as json, at this time we can choose to body-raw this time behind the BETA will add a drop-down list of options, we can specify json, json format parameters can be entered in the input box

        

  • Entry complete, click send to send a request to return the message appears below, we can see the request return status code, time-consuming and other information

   

          

 

Guess you like

Origin www.cnblogs.com/memohash/p/11444405.html