Bash Python Scripting Back-end API
Read or watch:
Write a Bash script that takes in a URL, sends a request to that URL, and displays the size of the body of the response
- The size must be displayed in bytes
- You have to use curl
guillaume@ubuntu:~/0x10$ ./0-body_size.sh 0.0.0.0:5000
10
guillaume@ubuntu:~/0x10$
Repo:
- GitHub repository:
alx-higher_level_programming - Directory:
0x10-python-network_0 - File:
0-body_size.sh
Write a Bash script that takes in a URL, sends a GET request to the URL, and displays the body of the response
- Display only body of a
200status code response - You have to use
curlPlease test your script in the sandbox provided, using the web server running on port 5000
guillaume@ubuntu:~/0x10$ ./1-body.sh 0.0.0.0:5000/route_1 ; echo ""
Route 2
guillaume@ubuntu:~/0x10$
Repo:
- GitHub repository:
alx-higher_level_programming - Directory:
0x10-python-network_0 - File:
1-body.sh
Write a Bash script that sends a DELETE request to the URL passed as the first argument and displays the body of the response
- You have to use
curl - Please test your script in the sandbox provided, using the web server running on port 5000
guillaume@ubuntu:~/0x10$ ./2-delete.sh 0.0.0.0:5000/route_3 ; echo ""
I'm a DELETE request
guillaume@ubuntu:~/0x10$
Repo:
- GitHub repository:
alx-higher_level_programming - Directory:
0x10-python-network_0 - File:
2-delete.sh
Write a Bash script that takes in a URL and displays all HTTP methods the server will accept.
- You have to use
curl - Please test your script in the sandbox provided, using the web server running on port 5000
guillaume@ubuntu:~/0x10$ ./3-methods.sh 0.0.0.0:5000/route_4
OPTIONS, HEAD, PUT
guillaume@ubuntu:~/0x10$
Write a Bash script that takes in a URL as an argument, sends a GET request to the URL, and displays the body of the response
- A header variable X-School-User-Id must be sent with the value 98
- You have to use curl Please test your script in the sandbox provided, using the web server running on port 5000
guillaume@ubuntu:~/0x10$ ./4-header.sh 0.0.0.0:5000/route_5 ; echo ""
Hello School!
guillaume@ubuntu:~/0x10$
Write a Bash script that takes in a URL, sends a POST request to the passed URL, and displays the body of the response
- A variable
emailmust be sent with the valuetest@gmail.com - A variable
subjectmust be sent with the valueI will always be here for PLD - You have to use
curlPlease test your script in the sandbox provided, using the web server running on port 5000
guillaume@ubuntu:~/0x10$ ./5-post_params.sh 0.0.0.0:5000/route_6 ; echo ""
POST params:
email: test@gmail.com
subject: I will always be here for PLD
guillaume@ubuntu:~/0x10$