0

有没有人尝试过 MongooseIM 2.0.0 Bets 服务来访问 Web 服务。

我能够执行此Swagger 站点链接中定义的 GET 调用,但无法获取 POST 请求,因为它为我使用 IP 地址而不是 localhost 的相同数据提供了错误。

在我的 Mongoose Im 错误响应中。

] 模拟器在节点 mongooseim@localhost 上的进程 <0.4026.0> 中出错,退出值:{{nocatch,[{reason,{error,{3,invalid_json}}},{mfa,{mongoose_api_admin,from_json,2}}, {stacktrace,[{jiffy,decode,2,[{file,"src/jiffy.erl"},{line,68}]},{mongoose_api_common,parse_request_body,1,[{file,"src/mongoose_api_common.erl" },{line,169}]},{mongoose_api_admin,from_json,2,[{file,"src/mongoose_api_admin.erl"},{line,114}]},{cowboy_rest,call,3,[{file," src/cowboy_rest.erl"},{line,976}]},{cowboy_rest,process_content_type,3,[{file,"src/cowboy_rest.erl"},{line,777}]},{cowboy_protocol,execute,4 ,[{file,"src/cowboy_protocol.erl"},{line,442}]}]},{req,[{socket,#Port<0.35385>},{transport,ranch_tcp},{connection,keepalive}, {pid,<0.4026.0>},{方法,<<"POST">>},{版本,'HTTP/1.1'},{peer,{{118,200,26,4},1036}},{host,<<"ec2-54-111-111-111.ap-southeast-1.compute.amazonaws.com" >>},{host_info,undefined},{port,8090},{path,<<"/api/messages">>},{path_info,undefined},{qs,<<>>},{qs_vals,undefined },{bindings,[]},{headers,[{<<"host">>,<<"ec2-54-111-111-111.ap-southeast-1.compute.amazonaws.com:8090"> >},{<<"user-agent">>,<<"curl/7.49.1">>},{<<"content-type">>,<<"application/json">>},{ <<"accept">>,<<"application/json">>},{<<"content-length">>,<<"208">>}]},{p_headers,[{<<"content -type">>,{<<"应用程序">>,<<"json">>,[]}},{<<"if-modified-since">>,undefined},{<<"if-none-match">>,undefined},{<<"if- unmodified-since">>,undefined},{<<"if-match">>,undefined},{<<"accept">>,[{{<<"application">>,<<"json"> >,[]},1000,[]}]}]},{cookies,undefined},{meta,[{media_type,{<<"application">>,<<"json">>,[]}} ,{charset,undefined}]},{body_state,waiting},{buffer,<<"{ \ \n \"caller\": \"+6512345699@ec2-54-111-111-111.ap-southeast- 1.compute.amazonaws.com\", \ \n \"to\": \"+6512345678@ec2-54-111-111-111.ap-southeast-1.compute.amazonaws.com\", \ \ n \"body\": \"你好兔子!\"\ \n }">>},{multipart,undefined},{resp_compress,false},{resp_state,waiting},{resp_headers,[{<<"content-type">>,[<<"application">> ,<<"/">>,<<"json">>,<<>>]}]},{resp_body,<<>>},{onresponse,undefined}]},{state,{http_api_state,[ <<"GET">>,<<"POST">>,<<"POST">>,<<"GET">>,<<"POST">>,<<"GET">>,<< "POST">>,<<"POST">>,<<"POST">>,<<"GET">>,<<"GET">>,<<"DELETE">>,<<"DELETE ">>,<<"POST">>,<<"删除">>,<<"POST">>,<<"PUT">>],[],undefined,<<"messages">>,undefined,admin,[]}}]},[{cowboy_rest,process_content_type,3,[{file, "src/cowboy_rest.erl"},{line,777}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,442}]}]} 2016-11- 02 05:25:37.428 [error] <0.4026.0> Ranch listener 'ejabberd_cowboy_166.36.16.166_8090' 因原因终止:{nocatch,[{reason,{error,{3,invalid_json}}},{mfa,{mongoose_api_admin ,from_json,2}},{stacktrace,[{jiffy,decode,2,[{file,"src/jiffy.erl"},{line,68}]},{mongoose_api_common,parse_request_body,1,[{file, "src/mongoose_api_common.erl"},{line,169}]},{mongoose_api_admin,from_json,2,[{file,"src/mongoose_api_admin.erl"},{line,114}]},{cowboy_rest,call, 3,[{file,"src/cowboy_rest.erl"},{line,976}]},{cowboy_rest,process_content_type,3,[{file,"src/cowboy_rest.erl"},{line,777}]},{cowboy_protocol,execute,4,[{file,...},. ..]}]},...]} 在 cowboy_rest:process_content_type/3 第 777 行

4

1 回答 1

1

这可能已经在这里得到了回答:https ://github.com/esl/MongooseIM/issues/1055 。我对吗?

于 2016-11-02T11:50:16.017 回答