|Keep It Simple, Stupid|
Re^4: Web::Magic 0.005by tobyink (Canon)
|on Jan 13, 2012 at 13:43 UTC||Need Help??|
No, it does not. Accepting XML does not count as supporting RDF. In general, RDF cannot be effectively processed with XML tools.
Web::Magic lets you specify any user agent string you like. The POD for the "set_request_header" method shows two examples of how to do precisely that:
And if you have a cookie jar you'd like to use:
Selecting stuff via CSS selectors is only a very small part of what Web::Magic does. (I almost regret using that feature in my first example.) Web::Magic aims to be the swiss army knife of HTTP-addressable resources. Whether it's a classic web page, a RESTful API, an Atom feed, or a WebDAV fileshare, Web::Magic can probably make dealing with it easier.
Let's suppose you have a RESTful API which supports up XML and JSON, depending on the request's HTTP Accept header. Web::Magic notices how you're trying to access the data, and does what you mean...
It's smart enough to figure out the HTTP headers you want:
POST /new-document HTTP/1.1 Host: example.com Content-Type: application/xml Accept: application/json, text/x-yaml <xmldoc>...</xmldoc>
But if you'd called it like this:
Then the request would be more like:
POST /new-document HTTP/1.1 Host: example.com Content-Type: application/x-www-form-urlencoded Accept: application/atom+xml, application/rss+xml title=Hello&foo=1