Original Request from Response?

26 views
Skip to first unread message

Ben

unread,
Dec 29, 2020, 4:23:06 PM12/29/20
to http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API
It's very likely that I am missing something simple here but looking for any ideas.

I am attempting concurrent connections using the example here: https://github.com/httprb/http/wiki/Thread-Safety

If one of the requests fails for whatever reason (I am particularly concerned about 401/404 in this case), any ideas on how I can determine which request it was? The response object doesn't seem to have anything that I can use to determine the original request url (of course unless I am missing something)

Any help is appreciated!

Ben

unread,
Dec 30, 2020, 9:35:11 AM12/30/20
to http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API
🤦🏻‍♂️
Facepalm on this one - sleeping on it helped! Updating here in case anyone else has a similar brain lapse - uri method on the response gives me what I need.

Joseph Corwin

unread,
Feb 23, 2021, 1:57:22 PM2/23/21
to http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API
Is there any way to generate the uri and preview it before sending the request?

Aleksey Zapparov

unread,
Mar 13, 2021, 8:58:24 AM3/13/21
to Joseph Corwin, http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API
You can use build_request that will return you a request object. then yiu can send it client. Also, you can use instrumentation feature to sniff requests being sent.

let's move the discussion to GitHub though.

--
You received this message because you are subscribed to the Google Groups "http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to httprb+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/httprb/46885f05-4222-4ce0-bffc-002cc8284df8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages