diff --git a/README.md b/README.md index d0b5bde..7b7e88d 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,6 @@ puts stack_exchange.users ``` See the [examples directory](http://github.com/jnunemaker/httparty/tree/master/examples) for even more goodies. - ## Command Line Interface httparty also includes the executable `httparty` which can be diff --git a/examples/README.md b/examples/README.md index 23f18d6..e79ddc4 100644 --- a/examples/README.md +++ b/examples/README.md @@ -84,3 +84,6 @@ * [Accessing x509 Peer Certificate](peer_cert.rb) * Provides access to the server's TLS certificate + +* [Accessing IDNs](idn.rb) + * Uses a `get` request with an International domain names, which are Urls with emojis and non-ASCII characters such as accented letters. \ No newline at end of file diff --git a/examples/idn.rb b/examples/idn.rb new file mode 100644 index 0000000..4c3d9ba --- /dev/null +++ b/examples/idn.rb @@ -0,0 +1,10 @@ +dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')) +require File.join(dir, 'httparty') +require 'pp' + +class Idn + include HTTParty + uri_adapter Addressable::URI +end + +pp Idn.get("https://i❤️.ws/emojidomain/💎?format=json") \ No newline at end of file