Microsoft Graph创建联系人问题

时间:2020-05-29 13:30:16

标签: php sdk microsoft-graph-api

当我在Microsoft图形中创建联系人时,出现以下问题

import requests
import html2text
import openpyxl
import re
from openpyxl.cell.cell import ILLEGAL_CHARACTERS_RE

with open('crawlingweb.csv')as f:
    content=f.readlines()
    content=[x.strip()for x in content]

excel_file=openpyxl.Workbook()
excel_sheet=excel_file.active

for i in range(50):
    url=content[i]
    req=requests.get(url)
    html=req.text
    raw=html2text.html2text(html)
    raw = ILLEGAL_CHARACTERS_RE.sub(r'', raw)
    excel_sheet.append([raw])

excel_file.save('crawling.xlsx')
excel_file.close()

这发生在以下邮政数据中

HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: application/json
request-id: xxx
client-request-id: xxx
Strict-Transport-Security: max-age=31536000
Date: Fri, 29 May 2020 13:23:55 GMT
Content-Length: 315

{
  "error": {
    "code": "RequestBodyRead",
    "message": "An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartArray' node was expected.",
    "innerError": {
      "request-id": "xxxx",
      "date": "2020-05-29T13:23:55"
    }
  }
}

我正在使用已经管理过的PHP SDK生产请求,

0 个答案:

没有答案