Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of getting the return value of HTTP by shell

Shulou Source: shulou.com Published: 2022-06-03 02:24:10 09月22日 Update

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

Tags: Commands users programming languages languages programming programs outputs structures controls interpretations ordinary more than that things information kernels branches actually applications interfaces Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Docker Xiaomi MySQL Huawei