// 其中cmd都输入/verify
res = cli.Post(cmd,"verifyKey=1234567890", "text/plain");
httplib::Params params{
{"verifyKey", "1234567890"}
};
res = cli.Post(cmd, params);
运行结果:
mcl/logs/latest.log部分:
2022-10-02 06:44:50 E/Mah Debug: kotlinx.serialization.json.internal.JsonDecodingException: Expected start of the object '{', but had 'EOF' instead
JSON input: verifyKey=1234567890 kotlinx.serialization.json.internal.JsonDecodingException: Expected start of the object '{', but had 'EOF' instead JSON input: verifyKey=1234567890 at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24) at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32) at kotlinx.serialization.json.internal.AbstractJsonLexer.fail(AbstractJsonLexer.kt:524) at kotlinx.serialization.json.internal.AbstractJsonLexer.fail$kotlinx_serialization_json(AbstractJsonLexer.kt:221) at kotlinx.serialization.json.internal.AbstractJsonLexer.unexpectedToken(AbstractJsonLexer.kt:204) at kotlinx.serialization.json.internal.StringJsonLexer.consumeNextToken(StringJsonLexer.kt:74) at kotlinx.serialization.json.internal.StreamingJsonDecoder.beginStructure(StreamingJsonDecoder.kt:41) at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.internal.dto.VerifyDTO$$serializer.deserialize(auth.kt:17) at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.internal.dto.VerifyDTO$$serializer.deserialize(auth.kt:17) at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59) at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:36) at kotlinx.serialization.json.Json.decodeFromString(Json.kt:100) at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.internal.serializer.BuiltinJsonSerializer.decode(BuiltinJson.kt:76)
at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.http.router.VerifyKt$authRouter$1$invoke$$inlined$httpVerify$1$1.invokeSuspend(dsl.kt:200)
at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.http.router.VerifyKt$authRouter$1$invoke$$inlined$httpVerify$1$1.invoke(dsl.kt)
at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.http.router.VerifyKt$authRouter$1$invoke$$inlined$httpVerify$1$1.invoke(dsl.kt)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.routing.Routing.executeResult(Routing.kt:155)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.routing.Routing.interceptor(Routing.kt:39)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:107)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invokeSuspend(Authorization.kt:41)
at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invoke(Authorization.kt)
at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invoke(Authorization.kt)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler.intercept(HttpRouterAccessHandler.kt:36)
at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler.access$intercept(HttpRouterAccessHandler.kt:25)
at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler$Feature$install$1.invokeSuspend(HttpRouterAccessHandler.kt:91)
at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler$Feature$install$1.invoke(HttpRouterAccessHandler.kt)
at mirai-api-http-2.6.2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler$Feature$install$1.invoke(HttpRouterAccessHandler.kt)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:127)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
at mirai-api-http-2.6.2.jar[shared]//io.ktor.server.cio.CIOApplicationEngine$handleRequest$2.invokeSuspend(CIOApplicationEngine.kt:196)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
main.cpp:
试过以下办法结果都相同:
运行结果:
mcl/logs/latest.log部分: