Request, Response

Article Directory

Request method

  1. get: is used to retrieve data, retreive the Data The specified from AT A Resource Server.
    GET request is used to request data only, not modify any resources. It is a safe and effective way.
  2. post: be used to send data to the API server to create or update a resource. It is used to transmit the data to the server to create or modify data. It is used to store data in the request body http request's.
  3. put:simlar to post.
  4. patch:
  5. delete:

Request

  1. Javax.servlet.http.HttpServletRequest
    the GetHeader ()
    the Return String detailed description of the request header, specified
    the If request does not include the include A header of specified Not name, return null
    the If for the same name, there are multiple headers, return the first method of this head in the request, the request to return the first head, the header name is case insensitive header names are case insensitive, you can use the any WHIS Method request header the this
    Public java.lang.String getHeader (the java.lang. String name)

Response

JSON

  1. Analog data formats: a single data
{"a":"2.12","b":"2.12"}
  1. Array Format:
{"a":"",
[
{"b":"b1","c":"2.12"},
{"b":"b1","c":"2.12"}
]
}
  1. String format:
{
"engineeringId":"01",
"versionId":"01",
"documentId":"01",
"calculationFloor":"1楼",
"elevationList":["a","b"]
}
  1. String [] ids and the Get Request List ids Post request differences and
    at the same post requests the postman manner:
    [ ". 1", "2", ". 3"]
    GET request: param: ids 1,3 - -> last path / api / delete / ids = 1,3
    the get request: String [] to the controller layer will be converted into { ". 1", ". 3"}
    List <> is the form size = 2

  2. List JSONArray turn sub-String

JSONArray.parseArray(JSON.toJSONString(ids)).toString
和JSON.toJSONString(ids)是等价的
Released four original articles · won praise 0 · Views 50

Guess you like

Origin blog.csdn.net/fireworksunshine/article/details/105387920