从 Python 发送 POST 请求时出错

时间:2021-07-22 05:56:30

标签: python post python-requests urllib httplib

我在从 Python 发送 POST 请求时收到错误:-

my_headers = {
    'Authorization':'Bearer TOKEN',
    'Content-Type':'application/json',
    'Accept':'*/*'
    }

query = {
  'templateId':'DidDocumentModule:DIDDocument',
  'contractId':'00ae84c7187a15a65ee0f66b92d9aba2f7f3595f57de6f09ad7fc7f53af75c6336',
  'choice':'Archive',
  'argument':{
      }
  }


  response = requests.post("http://127.0.0.1:7575/v1/exercise", data = query, headers 
  = my_headers)

我收到以下错误:-

原因:spray.json.Json``Parser$ParsingException:在输入索引 0(第 1 行,位置 1)处出现意外字符“e”,

为什么会发生,我该如何解决

0 个答案:

没有答案