We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a42c27 commit 5a47c1cCopy full SHA for 5a47c1c
1 file changed
loading_api_wrapper/api.py
@@ -62,3 +62,22 @@ def search(self, query):
62
}
63
64
return response.json()
65
+
66
+ def get_post(self, post_id):
67
+ if not post_id:
68
+ return {"code": 404, "message": '"post_id" is not allowed to be empty'}
69
70
+ url = f"{API_URL}/{API_VERSION}/posts/{post_id}"
71
+ headers = {
72
+ "User-Agent": USER_AGENT,
73
+ }
74
75
+ response = requests.get(url, headers=headers)
76
77
+ if response.status_code == 200:
78
+ return {
79
+ "code": response.status_code,
80
+ "post": response.json(),
81
82
83
+ return response.json()
0 commit comments