HTTP Error return error code:401 unauthorizeddepending on the HTTP return code, the meaning should be unauthorized, no input account and password, so the solution is to carry the password directly in the HTTP packet. first Use the shell to generate the base64 encoding for user and password
The information for account Admin,password as admin is encoded as ywrtaw46ywrtaw4= by Base64.
$ echo-n Admin:admin | base64ywrtaw46ywrtaw4=
The same can also be used to verify whether the account is Admin,password for admin.
$ echo-n ywrtaw46ywrtaw4= | Base64-d
After obtaining the Base64 encoded results, add the following in the HTTP format of the GET request:
Authorization:basic ywrtaw46ywrtaw4=
You can solve the 401 error code problem.
Attach the HTTP Error code table:
All HTTP status codes and their definitions.
Code indication
2XX success
200 OK; request completed.
201 OK; followed by post command.
202 OK; accepted for processing but not completed.
203 normal; partial information - the information returned is only a part.
204 OK; no response - the request has been received, but there is no information to be returned.
3xx redirection
301 moved - the requested data has a new location and the change is permanent.
302 found - the requested data temporarily has a different URI.
303 see other - the response to the request can be found under another URI and should be retrieved using the get method.
304 unchanged - the document was not altered as expected.
305 use proxy - the requested resource must be accessed through the proxy provided in the location field.
306 not used - no longer used; keep this code for future use.
Error in 4xx client
400 bad request - there is a syntax problem in the request or the request could not be satisfied.
401 unauthorized - unauthorized client access to data.
402 payment required - indicates that the billing system is in effect.
403 Forbidden - access is not required even if authorized.
404 Not Found - the server could not find the given resource; the document does not exist.
407 proxy authentication request - the client must first authenticate itself with a proxy.
415 unsupported media type - server rejected the service request because the format of the requesting entity is not supported.
Error in 5xx server
500 internal error - the server was unable to complete the request due to an unexpected condition.
501 not running - the requested tool is not supported by the server.
502 error Gateway - the server received an invalid response from the upstream server.
503 cannot get service - the server cannot process the request because it is temporarily overloaded or maintained.
HTTP Error return error code:401 unauthorized