mirror of https://gitlab.com/bashrc2/epicyon
Handle no post result
parent
a21b7fd958
commit
c3c26ad2e9
|
@ -68,7 +68,9 @@ def postJson(session,postJsonObject: {},federationList: [],inboxUrl: str,headers
|
||||||
return None
|
return None
|
||||||
|
|
||||||
postResult = session.post(url = inboxUrl, data = json.dumps(postJsonObject), headers=headers)
|
postResult = session.post(url = inboxUrl, data = json.dumps(postJsonObject), headers=headers)
|
||||||
|
if postResult:
|
||||||
return postResult.text
|
return postResult.text
|
||||||
|
return None
|
||||||
|
|
||||||
def postJsonString(session,postJsonStr: str, \
|
def postJsonString(session,postJsonStr: str, \
|
||||||
federationList: [], \
|
federationList: [], \
|
||||||
|
@ -137,5 +139,6 @@ def postImage(session,attachImageFilename: str,federationList: [],inboxUrl: str,
|
||||||
with open(attachImageFilename, 'rb') as avFile:
|
with open(attachImageFilename, 'rb') as avFile:
|
||||||
mediaBinary = avFile.read()
|
mediaBinary = avFile.read()
|
||||||
postResult = session.post(url=inboxUrl, data=mediaBinary, headers=headers)
|
postResult = session.post(url=inboxUrl, data=mediaBinary, headers=headers)
|
||||||
|
if postResult:
|
||||||
return postResult.text
|
return postResult.text
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in New Issue