I echo anonymonk’s request for clarification. Plack/PSGI is server side. It doesn’t, so far, make sense to answer your question with Plack code. Here is some more complete stuff for anyone to play with. I would suggest that the URI object’s methods are superior to URI::Split, so I include them after the split. One thing you might consider, and who knows, might be leading to your problem, the server doesn’t get the fragment (I mention it partly because it was an issue for me once and you present it in code dealing with server responses). Only the client knows about fragments; you can scan the YAML dump and see everything the server code gets.

# Server plackup -MYAML -e 'sub { warn Dump(+shift), $/; [ 200, [], [ "OHAI" ]] + }' HTTP::Server::PSGI: Accepting connections at http://0:5000/
# Client use 5.16.2; use strict; use HTTP::Request; use LWP::UserAgent; use URI::Split "uri_split"; my $uri = 'http://user:pass@localhost:5000/some/path?o=hai#frag'; my $request = HTTP::Request->new( GET => $uri ); my $user_agent = LWP::UserAgent->new; my $response = $user_agent->request($request); if ( $response->is_success ) { my $uri = $response->request->uri; my ( $scheme, $auth, $path, $query, $frag ) = uri_split($uri); say join " + ", $scheme, $auth, $path, $query, $frag; for my $method (qw/ authority host port path fragment query /) { printf "%12s -> %s\n", $method, $uri->$method; } }

In reply to Re: Help with converting HTTP::Request to Plack::Request by Your Mother
in thread Help with converting HTTP::Request to Plack::Request by knox

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.