-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Asega-bryan07/alx-higher_le…
…vel_programming into main
- Loading branch information
Showing
10 changed files
with
10 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#!/bin/bash | ||
# 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 and must use curl | ||
# Bash script that takes in a URL, sends a request to that URL | ||
curl -s "$1" | wc -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
#!/bin/bash | ||
# 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 200 status code response | ||
# You have to use curl | ||
# test script in the sandbox provided, using the web server running on port 5000 | ||
# Bash script that takes in a URL, sends a GET request running on port 5000 | ||
curl -sL "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
#!/bin/bash | ||
# Bash script that sends a request to a URL passed as an argument, and | ||
# displays only the status code of the response. | ||
# You are not allowed to use any pipe, redirection, etc. | ||
# You are not allowed to use ; and && | ||
# You have to use curl | ||
# Bash script that sends a request to a URL passed as an argument, and displays only the status code of the response. | ||
curl -s -o /dev/null -w "%{http_code}" "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
#!/bin/bash | ||
# Bash script that sends a JSON POST request to a URL passed as the | ||
# first argument , and displays the body of the response. | ||
# Your script must send a POST request with the contents of a file, | ||
# passed with the filename as the second argument of the script, | ||
# in the body of the request | ||
# You have to use curl | ||
# Bash script that sends a JSON POST request to a URL passed as the first argument , and displays the body of the response. | ||
curl -s -H "Content-Type: application/json" -d "$(cat "$2")" "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
#!/bin/bash | ||
# Bash script that makes a request to 0.0.0.0:5000/catch_me | ||
# that causes the server to respond with a message containing | ||
# You got me! in the body of the response. | ||
# You have to use curl | ||
# You are not allow to use echo, cat, etc. to display the final result | ||
# test your script in the sandbox provided, using the web server | ||
# running on port 5000 | ||
curl -sL -X PUT -H "Origin: ALXSoftwareEngineering" -d "user_id=98" 0.0.0.0:5000/catch_me | ||
curl -sL -X PUT -H "Origin: ALXSoftwareEngineering" -d "user_id=98" 0.0.0.0:5000/catch_me "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#!/bin/bash | ||
# 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 | ||
# Bash script that sends a DELETE request to the URL passed as the first argument and displays the body of the response | ||
curl -sX DELETE "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/bin/bash | ||
# Bash script that takes in a URL and displays all HTTP methods | ||
# the server will accept.You have to use curl | ||
# Bash script that takes in a URL and displays all HTTP methods the server will accept; use curl | ||
curl -sI "$1" | grep "Allow" | cut -d " " -f 2- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
#!/bin/bash | ||
# 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 | ||
# Bash script that takes in a URL as an argument, sends a GET request to URL, and displays the body of the response | ||
curl -sH "X-School-User-Id: 98" "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
#!/bin/bash | ||
# Bash script that takes in a URL, sends a POST request to the passed URL | ||
# and displays the body of the response | ||
# A variable email must be sent with the value test@gmail.com | ||
# A variable subject must be sent with the value "I will always be | ||
# here for PLD" | ||
# You have to use curl | ||
# Bash script that takes in a URL, sends a POST request to the passed URL and displays the body of the response | ||
curl -s -X POST -d "email=test@gmail.com&subject=I will always be here for PLD" "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters