Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 wandering the Monastery: (10)
As of 2015-07-06 23:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (85 votes), past polls