-
GET
- requests.get()
- A get request is made where we ask an external system for a particular piece of data and they give that to us in the response.
-
POST
-
requests.post(url= , json=)
-
A post request is where we give the external system some piece of data and we're not so interested in the response we're getting back other than whether if it was successful or not
-
Example
- if you wanted to save a piece of data in Google sheets, then you might use the Google sheets API to post your data into your Google sheet.
- You want to use the Twitter API to post a tweet then your program is going to send your tweet through a post request to the Twitter API

-
PUT
- requests.put()
- Put is where you simply update a piece of data in the external service.
- Example
- if you had a spreadsheet in Google Sheets and maybe you want to update some of the values in the spreadsheet, then you would use a put request.
-
DELETE
- requests.delete()
- Delete is simply where you want to delete a piece of data in the external service like a tweet that you posted or a Facebook post.
Step1: Create user account
import requests
pixela_endpoint = "<https://pixe.la/v1/users>"
user_params = {
"token": "xxxxxxxxxxxx",
"username": "andy45571500",
"agreeTermsOfService": "yes",
"notMinor": "yes",
}
response = requests.post(url=pixela_endpoint, json=user_params)
print(response.text)
Appendix