The method of getting the return value of HTTP by shell
Shell is actually a command interpreter that interprets commands entered by the user and sends them to the kernel. Not only that, Shell has its own programming language for editing commands, which allows users to write programs made up of shell commands. Shell programming language has many characteristics of common programming language, for example, it also has loop structure and branch control structure. Shell programs written in this programming language have the same effect as other applications.
Users of each Linux system can have their own user interface or Shell to meet their own specialized Shell needs.
Requirements: to determine whether the returned value of an API in HTTP is normal, the command result is as follows:
[root@uga-hotel etc] # curl-I-o / dev/null-s-w% {http_code} http://127.0.0.1:10080/terminal-setting-service/status
four hundred and one
[root@uga-hotel etc] #
The notes are as follows:
-I only test HTTP headers
-m 10 query up to 10s
-o / dev/null masks the original output information
-s silent mode, does not output anything
-w% {http_code} controls extra output