【问题标题】:Error with pastebin API: Bad API request, invalid api_paste_formatpastebin API 出错:API 请求错误,api_paste_format 无效
【发布时间】:2014-08-23 20:41:16
【问题描述】:

我正在使用this APIthis is my program

每当我尝试将粘贴发送到 pastebin 时,我都会在 API 的第 77 行收到错误:

return resp;

我不确定我应该怎么做才能使帖子成功发送。

WinForms_Run.exe 中出现“PasteBin.PasteBinApiException”类型的第一次机会异常附加信息:错误的 API 请求,无效的 api_paste_format

非常感谢任何帮助。

【问题讨论】:

  • WinForms_Run.exe 中出现“PasteBin.PasteBinApiException”类型的第一次机会异常附加信息:错误的 API 请求,无效的 api_paste_format

标签: c# pastebin


【解决方案1】:

您遇到的异常实际上在 before return resp 行。

您应该在 PasteBinClient 的第 75 行放置一个断点并计算 resp 变量的内容。

根据pastebin API documentation,您应该会收到一条消息,告诉您您的请求到底出了什么问题:

Bad API request, invalid api_option
Bad API request, invalid api_dev_key
Bad API request, IP blocked
... etc

编辑:用户评论了确切的问题:invalid api_paste_format

在您的程序(第 31 行)中,您将“无”作为格式传递 - 您是否按照 API 文档的建议尝试过“文本”?

【讨论】:

  • 错误的 API 请求,无效的 api_paste_format - 我迷路了,新手
  • 非常感谢,现在说得通了。
  • 没问题,如果这回答了您的问题,请不要忘记点击“标记为答案”按钮(在左侧打勾)。 :)
  • 我会的,要等2分钟
猜你喜欢
  • 2015-10-24
  • 1970-01-01
  • 1970-01-01
  • 2021-03-16
  • 1970-01-01
  • 1970-01-01
  • 2020-04-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多