tags: javascript Front -end request
mistake: Required request parameter ‘username’ for method parameter type String is not present
reason: The request parameter type specified in the back -end is query, and I use Body.
POST requests that both Query and Body can pass the parameters. The Query parameters are fighting on the request address, and the value of the params can only be a string, which cannot pass the parameters of the object type. Body biography.
before fixing:
export function login(data) {
debugger
return request({
url: '/api/v1/tcp/auth/login',
method: 'post',
data:data
})
}
After modification:
export function login(data) {
debugger
return request({
url: '/api/v1/tcp/auth/login',
method: 'post',
params:data
})
}
Baidu translation example: Knowledge link: The role of __init__ initialization >>>> Knowledge link: the difference between GET request header and POST request body >>>> Knowled...
Today I received a new interface, which requires query parameters and body parameters. (Similar to this) By finding articles and combining your own projects, the final solution is as follows:...
Requirements: An interface is, POST request, request head content-type: "Application / JSON", request parameter type has two kinds of Body and Query. 1. First encapsulate the API interface: ...
Introduce the framework version I found many versions of the code on the Internet, but it didn't work. Either the body data could not be obtained, or after the request was repackaged to the back-end s...
Form form elements provide two ways to transfer data - get and post. Although they are all data submission methods, they do make a big difference in actual transmission. The get and post methods in th...
Transfer from: http: //www.cnblogs.com/oneword/archive/2011/06/06/2073533.html Get and Post request request difference 1. When using the Get request, displayed in the URL parameters, and using the Pos...
At the same: to submit all data to a remote server Differences: different locations submitted Scenarios...
1.get (default) value is transmitted form by its URL, the action attribute data added later; post form values are passed to the hidden http packet body, url visible. 2.get passing the form through u...
Blog reference to the summary made by w3school First understand what is HTTP? HTTP, also known as the Hypertext Transfer Protocol, is the most widely used network protocol on the Internet. The working...
The get request is generally to display class data or data query Post is generally used when logging in. Logging in generally requires verification of the token. It is better to use post. Basically al...