mirror of https://gitlab.com/bashrc2/epicyon
No second try
parent
5f31820ec6
commit
30774ef7e0
10
session.py
10
session.py
|
@ -92,11 +92,11 @@ def postJsonString(session,postJsonStr: str, \
|
||||||
|
|
||||||
postResult = session.post(url = inboxUrl, data = postJsonStr, headers=headers)
|
postResult = session.post(url = inboxUrl, data = postJsonStr, headers=headers)
|
||||||
if postResult.status_code<200 or postResult.status_code>202:
|
if postResult.status_code<200 or postResult.status_code>202:
|
||||||
if postResult.status_code==400:
|
#if postResult.status_code==400:
|
||||||
headers['content-type']='application/ld+json'
|
# headers['content-type']='application/ld+json'
|
||||||
postResult = session.post(url = inboxUrl, data = postJsonStr, headers=headers)
|
# postResult = session.post(url = inboxUrl, data = postJsonStr, headers=headers)
|
||||||
if not (postResult.status_code<200 or postResult.status_code>202):
|
# if not (postResult.status_code<200 or postResult.status_code>202):
|
||||||
return True
|
# return True
|
||||||
if postResult.status_code==401:
|
if postResult.status_code==401:
|
||||||
print('WARN: >>> Post to '+inboxUrl+' is unauthorized <<<')
|
print('WARN: >>> Post to '+inboxUrl+' is unauthorized <<<')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue