explain the difference between form data and request payload and Query String Parameters, whether to use post or get request, how to set content-type and so on
explain the difference between form data and request payload and Query String Parameters, whether to use post or get request, how to set content-type and so on
Demo: http://wfquery.top/demo/07.fo.
$.ajax({
type: 'POST',
url: '/',
form: $('form')
});
https://github.com/shy2850/wf...
https://github.com/shy2850/wf.
as a matter of fact, whether the "Content-Type" of the request header needs to be set at the front end is entirely determined by the server. Whether the above is in querystring-param or query-json format, it can be submitted in the same location. Therefore, in many cases, we need to set the format interaction specification for the agreement between the front and back end. You can also define the rules yourself without following this convention in the project.
URL is as follows:
scheme://user:password@host:port/path;params?query-sharpfrag
query
section is Query String Parameters
HTTP is as follows
<method> <request-URL> <version>
<header>
<entity-body>
request payload and form data are the contents of entity-body blocks, but parsing behaviors are distinguished by Content-type
.
generally form-data is `Content-type=application/x-www-form-urlencoded
the rest generally defaults to request payload (I don't know if the file is uploaded, but you can search it if you are interested).
Query String Parameters you can bring it regardless of the request method, depending on whether you want to parse it or not.
entity-body requires partial request methods
POST , PUT , PATCH , DELETE , OPTIONS , (UN) LINK , LOCK , PROPFIND , VIEW
and so on.
Previous: Convert ['{}, {}'] to [{}, {}] string array
Next: The third-level navigation menu of element-ui is expanded or folded at the same time
Open a page in vue and then the console will see two requests (the backend said no token was received) ...