<div dir="ltr"><div>Hello Erlangers</div><div><br></div><div>I am going through some basic steps learning cowboy, and I'm doing something wrong, but I can't figure it out.</div><div><br></div><div>In the code below, I'm pattern matching against cowboy_req:method(Req), and it _should_ be returning {'GET', _}, which takes me to the first branch of the case statement. But it keeps executing the default case.</div><div><br></div><div>I printed out what cowboy_req:method is returning, and it looks like GET, In the spirit of shotgun-debugging this I've tried matching against 'GET', "GET", <<'GET'>>, and <<"GET">>, none of which work</div><div><br></div><div>I'm sure there is something simple I am missing here. What is it?</div><div><br></div><div><br></div><div>Thank you for your time and patience :)</div><div><br></div><div>handle(Req, State) -></div><div>    Reply = case cowboy_req:method(Req) of</div><div>        {'GET', _} -></div><div>% this is never executed when I do a curl-GET against my app</div><div><span class="" style="white-space:pre">                                            </span>SomeMsg = "some message",</div><div><span class="" style="white-space:pre">                                                </span>{ok, Req2} = cowboy_req:reply(200,</div><div><span class="" style="white-space:pre">                                                                                                                                                                 </span>[{<<"content-type">>, <<"text/plain">>}],</div><div><span class="" style="white-space:pre">                                                                                                                                                                      </span>SomeMsg,</div><div><span class="" style="white-space:pre">                                                                                                                                                                   </span>Req),</div><div><span class="" style="white-space:pre">                                      </span>  {ok, Req2, State};</div><div>        _ -></div><div>% even though i am printing out what cowboy_req:method returns here and it says GET</div><div><span class="" style="white-space:pre">                                          </span>{FNORD, _} = cowboy_req:method(Req),</div><div>            {ok, R} = cowboy_req:reply(200, [], FNORD, Req),</div><div>            R</div><div>    end,</div><div>    {ok, Reply, State}.</div><div><br></div></div>