我正在从ejabberd 18.06中的自定义模块发送HTTP请求
我尝试了多个服务器地址,其中我的API可用于接收请求,并且CURL在同一服务器上工作。
我在连接服务器时收到错误消息。我尝试了多种选择,但未能成功。任何帮助??
Sep = "&",
Header = [],
ContentType = "application/x-www-form-urlencoded",
Post = [
"user_id=", To, Sep,
"message_from=", From, Sep,
"message_type=AC", Sep
],
HTTPOptions = [],
Options = [],
{ok, _ReqId} = httpc:request(post, {Url, Header, ContentType, list_to_binary(Post)}, HTTPOptions, [ {sync, false} ]),
{http,{#Ref <0.553383904.99614721.184438>,{错误,{failed_connect,[{to_address,{<<“ localhost” >>,443}}},{inet,[inet],{options,{socket_options ,[inet,{packet_size,0},{packet,0},{header,0},{active,false},{mode,binary}]}}}}}}}}}