Fix public
Add guest alternative Write some doc
This commit is contained in:
parent
eabca3e7bf
commit
ae6ee7e7a0
4 changed files with 94 additions and 16 deletions
|
|
@ -61,13 +61,16 @@ class APIClient(BaseModel):
|
|||
url += f"?{urlencode(query_params)}"
|
||||
|
||||
# Set up headers for the request
|
||||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
# Add the Authorization header with the access token if authentication is required
|
||||
if authenticate:
|
||||
token = self._access_token
|
||||
headers["Authorization"] = f"Bearer {token}"
|
||||
else:
|
||||
token = 'guest'
|
||||
|
||||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": f"Bearer {token}"
|
||||
}
|
||||
|
||||
|
||||
# Debugging output to show the request details before making the API call
|
||||
if self.debug:
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ def listpublic(API, lastEvaluatedKey=None) -> dict:
|
|||
Returns:
|
||||
dict: The list of public posts.
|
||||
"""
|
||||
post_list = API.make_request("GET", "content", f"post/public", authenticate=True, query_params=lastEvaluatedKey)
|
||||
post_list = API.make_request("GET", "content", f"public/posts", authenticate=False, query_params=lastEvaluatedKey)
|
||||
return post_list
|
||||
Loading…
Add table
Add a link
Reference in a new issue