Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Asega-bryan07 committed Jan 3, 2024
2 parents fdf7b6f + 5f3b538 commit 66dfe7a
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 41 deletions.
4 changes: 1 addition & 3 deletions 0x10-python-network_0/0-body_size.sh
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
6 changes: 1 addition & 5 deletions 0x10-python-network_0/1-body.sh
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"
6 changes: 1 addition & 5 deletions 0x10-python-network_0/100-status_code.sh
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"
7 changes: 1 addition & 6 deletions 0x10-python-network_0/101-post_json.sh
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"
8 changes: 1 addition & 7 deletions 0x10-python-network_0/102-catch_me.sh
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"
4 changes: 1 addition & 3 deletions 0x10-python-network_0/2-delete.sh
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"
3 changes: 1 addition & 2 deletions 0x10-python-network_0/3-methods.sh
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-
5 changes: 1 addition & 4 deletions 0x10-python-network_0/4-header.sh
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"
7 changes: 1 addition & 6 deletions 0x10-python-network_0/5-post_params.sh
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"
1 change: 1 addition & 0 deletions 0x10-python-network_0/6-peak.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/python3
def find_peak(list_of_integers):
find_peak = __import__('6-peak.txt').find_peak
'''
args:
list_of_integers(int): list of the integers where peak is to be found
Expand Down

0 comments on commit 66dfe7a

Please sign in to comment.