<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi Erlangers,</div><div><br></div><div>I'm learning Cowboy and facing a peculiar issue.</div><div><a href="https://pastebin.com/NQsrj1g0"><b>My handler code</b> is here.</a><br></div><div><br></div><div></div><div>I have a rest endpoint (POST) and accessing it with Postman show a crash report after giving response. But the very same request works find with CURL.<br></div><div><br></div><div><u><b>CURL Request</b>:</u></div><div>curl -X POST -d '{"name":"M4ver1k"}' -i -H "User-Agent: PostmanRuntime/7.6.1" -H "Cache-Control: no-cache" -H "postman-token: cc241d1b-d2f0-488d-86ec-0a06bbb13234" -H "connection: keep-alive" -H "Accept-Encoding: gzip, deflate" -H "Content-Type: application/json" -H "Accept: application/json" <a href="http://localhost:8080/api/">http://localhost:8080/api/</a><br></div><div><br></div><div><u><b>Crash Report:</b></u><br></div><div>crasher:<br>    initial call: cowboy_stream_h:request_process/3<br>    pid: <0.1023.0><br>    registered_name: []<br>    exception error: no try clause matching <br>                     #{bindings => #{},body_length => 17,cert => undefined,<br>                       charset => undefined,has_body => true,<br>                       has_read_body => true,has_sent_resp => true,<br>                       headers =><br>                           #{<<"accept">> => <<"application/json">>,<br>                             <<"accept-encoding">> => <<"gzip, deflate">>,<br>                             <<"cache-control">> => <<"no-cache">>,<br>                             <<"connection">> => <<"keep-alive">>,<br>                             <<"content-length">> => <<"17">>,<br>                             <<"content-type">> => <<"application/json">>,<br>                             <<"host">> => <<"localhost:8080">>,<br>                             <<"postman-token">> =><br>                                 <<"04b305c1-5214-461e-a1c3-8dcd6b80a621">>,<br>                             <<"user-agent">> => <<"PostmanRuntime/7.6.1">>},<br>                       host => <<"localhost">>,host_info => undefined,<br>                       media_type => {<<"application">>,<<"json">>,[]},<br>                       method => <<"POST">>,path => <<"/api/">>,<br>                       path_info => undefined,<br>                       peer => {{127,0,0,1},59002},<br>                       pid => <0.1022.0>,port => 8080,qs => <<>>,<br>                       ref => my_http_listener,scheme => <<"http">>,<br>                       sock => {{127,0,0,1},8080},<br>                       streamid => 1,version => 'HTTP/1.1'}<br>      in function  cowboy_rest:call/3 (/m4ver1k/learn/erlang/hello_cowboy/_build/default/lib/cowboy/src/cowboy_rest.erl, line 1576)<br>      in call from cowboy_rest:process_content_type/3 (/m4ver1k/learn/erlang/hello_cowboy/_build/default/lib/cowboy/src/cowboy_rest.erl, line 1100)<br>      in call from cowboy_rest:upgrade/4 (/m4ver1k/learn/erlang/hello_cowboy/_build/default/lib/cowboy/src/cowboy_rest.erl, line 288)<br>      in call from cowboy_stream_h:execute/3 (/m4ver1k/learn/erlang/hello_cowboy/_build/default/lib/cowboy/src/cowboy_stream_h.erl, line 296)<br>      in call from cowboy_stream_h:request_process/3 (/m4ver1k/learn/erlang/hello_cowboy/_build/default/lib/cowboy/src/cowboy_stream_h.erl, line 274)<br>    ancestors: [<0.1022.0>,<0.407.0>,<0.406.0>,ranch_sup,<0.395.0>]<br>    message_queue_len: 0<br>    messages: []<br>    links: [<0.1022.0>]<br>    dictionary: []<br>    trap_exit: false<br>    status: running<br>    heap_size: 1598<br>    stack_size: 27<br>    reductions: 770<br>  neighbours:</div><div><br></div><div><br></div><div>I have run out of options to triage this,trying to understand this behavior. <br></div><div><br></div><div>Regards</div><div>Maverick<br></div></div></div></div>