T
Tom Metge
we get a ton of these little posts, but i genuinely thought someone =
might find this useful (i certainly do):
http://github.com/tommetge/httprb
i've had to do more than my fair share of work with net/http and it =
sucks. because most of us spend more time writing web apps/services =
than we do consuming them in ruby, we have beautiful DSLs like sinatra =
to help us. it's about time we had the same for client work.
example:
get 'www.google.com'
# =3D> #<Net::HTTPOK 200 OK readbody=3Dtrue>
more complicated example (with custom headers and such):
res =3D get 'www.google.com' do |req|
req.header "x-some-key", "some value"
req.header "x-some-other-key", "some other value"
end
# =3D> #<Net::HTTPOK 200 OK readbody=3Dtrue>
you get the idea. feedback welcome. really, i mean that. lay in- i =
can take it
oh, one important note: unfortunately, this stomps all over sinatra =
(obviously) so they can't be used together- for now.
tom=
might find this useful (i certainly do):
http://github.com/tommetge/httprb
i've had to do more than my fair share of work with net/http and it =
sucks. because most of us spend more time writing web apps/services =
than we do consuming them in ruby, we have beautiful DSLs like sinatra =
to help us. it's about time we had the same for client work.
example:
get 'www.google.com'
# =3D> #<Net::HTTPOK 200 OK readbody=3Dtrue>
more complicated example (with custom headers and such):
res =3D get 'www.google.com' do |req|
req.header "x-some-key", "some value"
req.header "x-some-other-key", "some other value"
end
# =3D> #<Net::HTTPOK 200 OK readbody=3Dtrue>
you get the idea. feedback welcome. really, i mean that. lay in- i =
can take it
oh, one important note: unfortunately, this stomps all over sinatra =
(obviously) so they can't be used together- for now.
tom=