-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhackernewsstep2.py
More file actions
30 lines (23 loc) · 954 Bytes
/
hackernewsstep2.py
File metadata and controls
30 lines (23 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import requests
# Item and profile changes in hackernews
# Requests a resource at the requested URL.
def hackernewsgetapirequest():
req = requests.get('https://hacker-news.firebaseio.com/v0/updates.json?print=pretty')
print (req.text)
print ("Status Code", req.status_code)
# Indicates which techniques are supported.
def hackernewsoptionsapirequest():
req = requests.options('https://hacker-news.firebaseio.com/v0/updates.json?print=pretty')
print (req.text)
print ("Status Code", req.status_code)
# Returns meta information in that given URL.
def hackernewsheadapirequest():
req = requests.head('https://hacker-news.firebaseio.com/v0/updates.json?print=pretty')
print (req.text)
print ("Status Code", req.status_code)
# Requests a resource at the requested URL.
hackernewsgetapirequest()
# Indicates which techniques are supported.
hackernewsoptionsapirequest()
# Returns meta information in that given URL.
hackernewsheadapirequest()