HoneyryderChuck/httpx

The get and html chain

forthrin opened this issue · 5 comments

require 'httpx'
HTTPX.get('https://www.w3.org/TR/1998/REC-xml-19980210.xml').xml
HTTPX.get('https://www.example.com/').html
... undefined method `html' (NoMethodError)

Since when (and why) did this stop working?

Because it -did- work before, right...?

Feeling like a Christopher Nolan movie.

Hi, don't think that .html was ever supported.

Upgrade to feature request, then. Sounds like a one-liner if you already support .xml. Also, it's courteous to let OP close issues when they feel the request was addressed in a satisfactory fashion.

Upgrade to feature request, then.

Request not accepted. There's no obvious type to what that function should return, nor a reference library implementing such a parser, that justifies support in mainline. Also not really a common need, ad something you can easily implement for yourself via a plugin.

Also, it's courteous to let OP close issues

As owner of this repo, it's my decision. You asked a question, not an issue report, the question was answered.

HTTP.get(url).xml already returns Nokogiri::XML::Document. Why not .html returning Nokogiri::HTML5::Document?

the original .xml API was added out of convenience, there was never a plan to deeply integrate with nokogiri. In fact, it may be backfiring for users which use an alternative for xml, and the only argument for not removing the method is that it'd break someone's code.

As mentioned, adding an .html yourself should be easy enough.