gpt4 book ai didi

django - LinkedIn REST API 无法发送消息;无法解析邮箱项目文档 : error: Unexpected end of file after null

转载 作者:行者123 更新时间:2023-12-04 05:51:44 25 4
gpt4 key购买 nike

我在我正在 build 的网站上使用 Linkedin Rest Api,总的来说效果很好,唯一的问题是我无法向我的连接发送消息。

({'status': '400', 
'content-length': '302',
'transfer-encoding': 'chunked',
'vary': '*',
'server': 'Apache-Coyote/1.1',
'-content-encoding': 'gzip',
'date': 'Wed, 28 Mar 2012 22:52:35 GMT',
'x-li-request-id': 'QU0G42N6TV',
'nncoection': 'close',
'x-li-format': 'xml',
'content-type': 'text/xml;charset=UTF-8'},
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
\n<error>\n <status>400</status>
<timestamp>1332975155652</timestamp>
<request-id>QU0G42N6TV</request-id>
<error-code>0</error-code>
<message>Couldn\'t parse mailbox-item document: error: Unexpected end of file after null</message>\n</error>\n'

这就是我调用 api 的方式:

client.request(url,'POST','text/xml',param)

在哪里:
url = 'http://api.linkedin.com/v1/people/~/mailbox'

参数:
<?xml version='1.0' encoding='UTF-8'?><mailbox-item>
<recipients>
<recipient>
<person path='/people/TquMAMeCCD' />
</recipient>
</recipients>
<subject>Congratulations on your new position.</subject>
<body>Youre certainly the best person for the job!</body> </mailbox-item>

谢谢!

最佳答案

我的问题终于出现在标题上,我没有设置正确的内容类型。那修复了它。

关于django - LinkedIn REST API 无法发送消息;无法解析邮箱项目文档 : error: Unexpected end of file after null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9981286/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com