Try ld+json post

main2
Bob Mottram 2019-10-21 17:48:41 +01:00
parent 29f369d702
commit 5f31820ec6
1 changed files with 5 additions and 0 deletions

View File

@ -92,6 +92,11 @@ def postJsonString(session,postJsonStr: str, \
postResult = session.post(url = inboxUrl, data = postJsonStr, headers=headers)
if postResult.status_code<200 or postResult.status_code>202:
if postResult.status_code==400:
headers['content-type']='application/ld+json'
postResult = session.post(url = inboxUrl, data = postJsonStr, headers=headers)
if not (postResult.status_code<200 or postResult.status_code>202):
return True
if postResult.status_code==401:
print('WARN: >>> Post to '+inboxUrl+' is unauthorized <<<')
else: