gpt4 book ai didi

java - 500-内部服务错误-使用 eQSL

转载 作者:行者123 更新时间:2023-11-30 02:54:10 32 4
gpt4 key购买 nike

所以我试图在我的应用程序中为 eQSL 实时 api 实现 this interface,但我一直收到错误 500,并显示“您要查找的资源存在问题,无法显示”。我正在使用一个函数来帮助我写入表单,该表单可以在 Git Hub 上找到。我以前用过这个库,它可以工作,只是不适用于 eQSL api。我一辈子都弄不明白我做错了什么。这是我的代码:

multipart = new MultipartUtility(
"http://www.eqsl.cc/qslcard/ImportADIF.cfm", "UTF-8");

multipart.addHeaderField("User-Agent", "Mozilla/5.0 ( compatible )");
multipart.addHeaderField("Accept","identity");
multipart.addFormField("EQSL_USER", mUserName);
multipart.addFormField("EQSL_PSWD", mPassword);

multipart.addFilePartOutputStream("Filename", "HamFinder_"
+ mCallSign + ".adi", new OutputStreamer() {
@Override
public void writeStream(OutputStream outputStream)
throws IOException {
BufferedOutputStream out = null;
try {
out = new BufferedOutputStream(outputStream);
//Writes some output to out, I've done this way before, no problem.
} finally {
out.close();
}
}
});
List<String> response = multipart.finish();

我不断收到以下错误:

05-10 23:28:01.108: W/System.err(2456): java.io.IOException: Server returned non-OK status: 500, message Internal Server Error
05-10 23:28:01.120: W/System.err(2456): at com.kd7uiy.trustedQsl.MultipartUtility.finish(MultipartUtility.java:182)
05-10 23:28:01.120: W/System.err(2456): at com.kd7uiy.hamfinder.EqslUploader.writeToEqsl(EqslUploader.java:129)
05-10 23:28:01.120: W/System.err(2456): at com.kd7uiy.hamfinder.EqslUploader.uploadQso(EqslUploader.java:72)
05-10 23:28:01.124: W/System.err(2456): at com.kd7uiy.hamfinder.ElectronicQslManager$CommitToService.doInBackground(ElectronicQslManager.java:38)
05-10 23:28:01.124: W/System.err(2456): at com.kd7uiy.hamfinder.ElectronicQslManager$CommitToService.doInBackground(ElectronicQslManager.java:1)
05-10 23:28:01.124: W/System.err(2456): at android.os.AsyncTask$2.call(AsyncTask.java:287)
05-10 23:28:01.124: W/System.err(2456): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
05-10 23:28:01.124: W/System.err(2456): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
05-10 23:28:01.124: W/System.err(2456): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
05-10 23:28:01.124: W/System.err(2456): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
05-10 23:28:01.124: W/System.err(2456): at java.lang.Thread.run(Thread.java:841)

部分 HTML 代码是:

05-10 23:28:01.108: I/System.out(2456):   <h2>500 - Internal server error.</h2>
05-10 23:28:01.108: I/System.out(2456): <h3>There is a problem with the resource you are looking for, and it cannot be displayed.</h3>

知道我做错了什么吗?

最佳答案

看起来我的问题是有两个 Agent 字段,multipart.addHeaderField("User-Agent", "Mozilla/5.0 (compatible)"); 和一个默认添加在 多部分()。删除一个修复了错误。

关于java - 500-内部服务错误-使用 eQSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23587467/

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