Your Ruby app includes a bunch of HTTP clients already. It's time to make use of them.
Add this line to your application's Gemfile
:
gem 'httpalooza'
And then execute:
$ bundle
HTTPalooza tracks the bleeding edge, so we recommend leaving the gem version unlocked for best results.
$ bundle exec bin/console
irb(main):001:0> ap HTTPalooza.invite.patron_to_the_party.and_use_typhoeus_too.lets_also_use_http_client_and_plain_old_curl_plus.rest_client_invited_itself_too.get("http://example.com")
{
:patron => <HTTPalooza::Response:70225910064600 code=200 body="<!doctype html>\n<html>\n<...,
:typhoeus => <HTTPalooza::Response:70225915728560 code=200 body="<!doctype html>\n<html>\n<...,
:http_client => <HTTPalooza::Response:70225924014880 code=200 body="<!doctype html>\n<html>\n<...,
:curl => <HTTPalooza::Response:70225919916880 code=200 body="<!doctype html>\n<html>\n<...
}
HTTPalooza uses Postgres's cutting edge technology, but needs your help to reach the clouds. Please install pgsql-http (https://github.com/pramsey/pgsql-http) along with Postgres (https://www.postgresql.org/) and create a database httpalooza
with the http
extension installed.
$ createdb httpalooza
$ psql httpalooza
httpalooza=# CREATE EXTENSION http;
We want HTTPalooza to support all stacks and architectures. Absolutely no one has called us out on only supporting Postgres, and we want to keep it that way.
To help streamline your Oracle development setup, there's a local development virtual machine and a tutorial on how to install Oracle's instantclient. Keep in mind the tutorial is installing a version 11_2
, which is outdated, so adjust your path if you are installing a newer version of oracle instant client (at the current moment it is version 12_1
). In order for your local machine to connect with the virtual machine, make sure you have port forwarding from port 1521
on your virtual machine to localhost port 1521
. This link might be helpful. Good luck.
The defaults for the virtual machine are with user system
with password oracle
and runs on port 1521
. HTTPalooza uses these and isn't yet configurable.
Next part is deliberately manual. Start up sqlplus:
$ORACLE_HOME/sqlplus system/oracle@localhost
Now open up network connections for the system
user.
BEGIN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('httpalooza.xml', 'Allow usage to the UTL network packages', 'SYSTEM', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('httpalooza.xml' ,'SYSTEM', TRUE, 'resolve');
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('httpalooza.xml' ,'SYSTEM', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('httpalooza.xml','*');
END;
If you want validation or want to understand what these lines of PL/SQL do, you can find that information in a non-verified blog or the Oracle documentation.
After checking out the repo, run bin/setup
to install dependencies. Then, run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
HTTPalooza doesn't include an adapter for your favorite client? It's simple to add one. Create a new subclass of HTTPalooza::Players::Base
and implement the #response
method.
- Fork it ( https://github.com/[my-github-username]/httpalooza/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Do not bump the version in your pull request. We will do that in a separate commit (possibly including other changes).