Skip to content


Subversion checkout URL

You can clone with
Download ZIP


httpclient support #6

nbibler opened this Issue · 5 comments

4 participants


The soap4r gem currently uses httpclient gem which is not currently disabled when used with fakeweb (allow_net_connect = false).

It looks as though some work has been done at although it is now a bit out of date.


So, I put together my own patch which adds this support - however - it's certainly not for mainline use as it is specific to httpclient + soap4r at the moment:

However, it raised the interesting idea of abstracting the generated Net::HTTPResponse object to fit other libraries. In this case, I had to extend the response to carry status and content methods. It may be more useful to have a custom response object come back through FakeWeb.response_for, in most cases the current Net::HTTP-like object, but for httpclient, for instance, a slightly modified version. If that were available, I wouldn't have had to monkey with Net::HTTPHeader and HTTPClient in this patch.

Just a thought.


Note to self, httpclient is now on github.


implemented the patch in a branch on my fork:

working in tests relying on soap4r


(would have sent a pull request, but didn't want to write tests and don't know how to make it generic)


Hey guys, I just runned into the same issue. I need to mock soap4r gem and it uses httpclient. I found this thread, that points to a fork which has the specific changes to fake httpclient, but it seems a bit older (January 05, 2009)..

Do you guys have any news about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.