简体   繁体   English

如何解决InterFAX python库400错误?

[英]How to solve InterFAX python library 400 error?

I've been working on a django project that needs to send faxes.我一直在做一个需要发送传真的 django 项目。
For sending faxes I am using interfax python library .对于发送传真,我使用interfax python 库
To generate pdf from html, I am using xhtml2pdf.要从 html 生成 pdf,我使用的是 xhtml2pdf。
I wrote like below, and it didn't work and threw an error.我写如下,但它不起作用并引发错误。 I don't know what to do now.我现在不知道该怎么办。
Please help.请帮忙。

The code编码

# interfax authentication
interfax_password = config("INTERFAX_PASSWORD")
interfax_account = config("INTERFAX_ACCOUNT")
interfax = InterFAX(username=interfax_account, password=interfax_password)

f = File(interfax, pdf, mime_type="application/pdf")
fax_number = config("INTERFAX_DESTINATION")

# actually sending the data
fax = interfax.outbound.deliver(fax_number=fax_number, files=[f])

The error thrown 抛出的错误
equests.exceptions.HTTPError: 400 Client Error: Bad Request for url:https://rest.interfax.net/outbound/faxes?faxNumber=111111111

Thank you in advance 先感谢您

我想我只需要直接使用API​​。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM