Xiaobai's help post. Please help with the problem of passing token parameters in the header.
silver
silver 2019-06-15 08:51:46
0
0
1033

This is a picture bed interface. The first step is to verify the user. The returned data is successful.

{"code":200,"msg":"success", "data":{"token":"8961576c9090ef0902c4b89406f8d557"},"time":1560559347}

There is no problem with header parameter passing in the next step, please give me some guidance.


The second step is to upload the image. If there is a parameter token in the header during the request, the interface will authenticate the token, and the uploaded image will also be under the token user, otherwise the upload will fail.

The upload request method is post

url: https://domain name/api/upload

Request parameters

Parameters Name Type

image file

Returns json

Upload example

POST /api/upload HTTP/1.1
Host: https://domain name
Connection: keep-alive
Content-Length: 57398
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx2mqINKHVPJ8yMdK

--- ---WebKitFormBoundaryx2mqINKHVPJ8yMdK
Content-Disposition: form-data; name="image"; filename="test.png"
Content-Type: image/png


First, thank you

silver
silver

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!