Linux | Use the wget command to call the service interface

Follow wx:CodingTechWork

introduction

  In the docker container, if you want to call a certain service interface, you find that the curl command is not installed, but there is the wget command. This time I will summarize the use of wget.

Wget command practice

container access

  1. view container
    docker ps
  2. into the container
    docker exec -it <container_id> /bin/sh

wget call interface

Execution of wget in the container

GET interface

wget http://127.0.0.1:8080/xxxx

POST interface

wget --header="Content-Type: application/json" --post-data='{"key":"value"}' http://127.0.0.1:8080/xxx

おすすめ

転載: blog.csdn.net/Andya_net/article/details/132262133