Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: json return value (sub WWW::Mechanize::is_mimetype )

by Anonymous Monk
on Jul 11, 2013 at 08:57 UTC ( #1043663=note: print w/ replies, xml ) Need Help??


in reply to Re: json return value
in thread json return value

is_json is like is_html, one trick pony :)

use MIME::Types; our $mimetypes = MIME::Types->new; sub WWW::Mechanize::is_mimetype { goto &WWW::Mechanize::is_mt } sub WWW::Mechanize::is_mt { $mimetypes->mimeTypeOf( $_[1] )->equals( $ +_[0]->ct ) }


Comment on Re^2: json return value (sub WWW::Mechanize::is_mimetype )
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043663]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2014-12-17 22:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (40 votes), past polls