cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
So I am using HTTP::Daemon. I almost have it working, but I can't figure out how to get it to complete the transaction withe the browser. Here is the server code:
And here is the html:use feature ':5.10'; $| = 1; use HTTP::Daemon; use HTTP::Status; my $d = HTTP::Daemon->new(LocalPort => 8080) || die; print "Please contact me at: <URL:", $d->url, ">\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { if ($r->method eq 'GET') { say $r->uri->query; $c->send_status_line; } else { $c->send_error(RC_FORBIDDEN) } } $c->close; undef($c); }
When I click submit, the server gets the request and prints the query string, but the send_status_line does not produce any response by the browser. It continues to sit there waiting for a response. How to fix?<html> <form action="http://127.0.0.1:8080/process/" method="get"> <input type="checkbox" name="vehicle1" value="Bike"> <label for="vehicle1"> I have a bike</label><br> <input type="checkbox" name="vehicle2" value="Car"> <label for="vehicle2"> I have a car</label><br> <input type="checkbox" name="vehicle3" value="Boat" checked> <label for="vehicle3"> I have a boat</label><br><br> <input type="submit" value="Submit"> </form> </html>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to complete a transaction with HTTP::Daemon?
by Corion (Patriarch) on Jul 08, 2021 at 06:08 UTC | |
|
Re: How to complete a transaction with HTTP::Daemon?
by karlgoethebier (Abbot) on Jul 08, 2021 at 10:42 UTC |