Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Dancer bugs? send_file(), content type, and response_content_is()

by hardburn (Abbot)
on Mar 01, 2013 at 16:25 UTC ( #1021293=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    get '/javascripts/:file' => sub {
        my ($file) = splat;
    ...
            content_type => 'text/javascript',
        );
    };
    
  2. or download this
    response_status_is  [ GET => '/javascripts/test.js' ], 200,
        'response status is 200 for /js/test.js';
    response_content_is [ GET => '/javascripts/test.js' ], 'var test = 1;'
    +, 'Fetched JS';
    response_headers_include [ GET => '/javascripts/test.js' ],
        [ 'Content-Type' => 'text/javascript' ], "MIME type set for JS";
    
  3. or download this
    not ok 4 - Fetched JS
    #   Failed test 'Fetched JS'
    ...
    #   Failed test 'MIME type set for JS'
    #   at t/002_index_route.t line 15.
    # Looks like you failed 2 tests of 5.
    
  4. or download this
    0  Dancer::Response=HASH(0x23dca98)
       'content' => GLOB(0x23eb3e8)
    ...
          'last-modified' => 'Fri, 01 Mar 2013 15:31:21 GMT'
       'pass' => 0
       'status' => 200
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1021293]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2014-09-02 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (30 votes), past polls