Java 서블릿에 httpc 요청을하는 데 문제가 있습니다. 내 로컬 시스템에서 코드가 제대로 작동하지만 ejabberd 서버의 erlang 파일에서 호출을 실행하면 잘못된 인수 예외가 발생합니다. 나는 ejabberd 서버의 얼랑 파일에 코드를 복사하여 나는이 예외 가지고httpc 요청 : 잘못된 인수 예외 길이
Body = "deviceToken=dy....[Very long FCM token]....b1&sender=epeued7o3z", inets:start(), httpc:request(post, { "http://192.168.2.110:8080/020/service", [], "application/x-www-form-urlencoded", Body }, [], []).
:
2017-11-24 18:05:40 =CRASH REPORT==== crasher: initial call: httpc_handler:init/1 pid: <0.522.0> registered_name: [] exception error: bad argument: [{erlang,length,[[100,101,118,105,99,101,84,111,107,101,110,61,<<"dy....[Very long FCM token]...Kn4b1">>,38,115,101,110,100,101,114,61|<<"epeued7o3z">>]],[]},{httpc_request,body_length,1,[{file,"httpc_request.erl"},{line,233}]},{httpc_request,post_data,4,[{file,"httpc_request.erl"},{line,208}]},{httpc_request,send,4,[{file,"httpc_request.erl"},{line,85}]},{httpc_handler,connect_and_send_first_request,3,[{file,"httpc_handler.erl"},{line,815}]},{httpc_handler,init,1,[{file,"httpc_handler.erl"},{line,238}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}] ancestors: [httpc_handler_sup,httpc_sup,inets_sup,<0.439.0>] message_queue_len: 0 messages: [] links: [<0.445.0>,#Port<0.14269>] dictionary: [] trap_exit: true status: running heap_size: 610 stack_size: 27 reductions: 978 neighbours: 2017-11-24 18:05:40 =SUPERVISOR REPORT==== Supervisor: {local,httpc_handler_sup} Context: child_terminated Reason: {badarg,[{erlang,length,[[100,101,118,105,99,101,84,111,107,101,110,61,<<"dy...[Very long FCM token].....Kn4b1">>,38,115,101,110,100,101,114,61|<<"epeued7o3z">>]],[]},{httpc_request,body_length,1,[{file,"httpc_request.erl"},{line,233}]},{httpc_request,post_data,4,[{file,"httpc_request.erl"},{line,208}]},{httpc_request,send,4,[{file,"httpc_request.erl"},{line,85}]},{httpc_handler,connect_and_send_first_request,3,[{file,"httpc_handler.erl"},{line,815}]},{httpc_handler,init,1,[{file,"httpc_handler.erl"},{line,238}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]} Offender: [{pid,<0.522.0>},{id,undefined},{mfargs,{httpc_handler,start_link,undefined}},{restart_type,temporary},{shutdown,4000},{child_type,worker}]
인가를
이
내 로컬 시스템에서 내 코드입니다 내 지역 프로그램에서 잘 작동하기 때문에 신체 길이가 잘못되었거나 오래 걸리는 것일까 요? 서블릿에 대한 요청이 문제가되어서는 안됩니다.미리 감사드립니다.
대단히 고맙습니다.이 작품은 저에게 좋습니다 !!! – Ghostw4lk