Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a032e75

Browse files
committed
Excercises Done
1 parent bd46239 commit a032e75

File tree

4 files changed

+29
-1
lines changed
  • .learn/resets
  • exercises

4 files changed

+29
-1
lines changed

‎.learn/resets/12-post-request/app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import requests
2+
3+
# Your code here
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import requests
2+
3+
response = requests.post("https://assets.breatheco.de/apis/fake/sample/save-project-json.php")
4+
print(response.text)

‎exercises/12-post-request/app.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
import requests
22

3+
url = "https://assets.breatheco.de/apis/fake/sample/post.php"
4+
5+
response = requests.post(url)
6+
7+
print(response.text)
8+
39
# Your code here

‎exercises/13-post-request-body/app.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
import requests
22

3-
response = requests.post("https://assets.breatheco.de/apis/fake/sample/save-project-json.php")
3+
4+
url = "https://assets.breatheco.de/apis/fake/sample/save-project-json.php"
5+
6+
data = {
7+
"id": 2323,
8+
"title": "Very big project"
9+
}
10+
11+
# Setting the headers
12+
headers = {
13+
"Content-Type": "application/json"
14+
}
15+
16+
# Sending POST request with dictionary data
17+
response = requests.post(url, json=data, headers=headers)
18+
419
print(response.text)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /