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
- view container
docker ps
- 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