You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are 2 things I'd like to do with this library and not sure how to do it.
First, I'd like to print out the request to see if everything looks correct. I'm thinking something like HTTP.headers(some_hash).get(some_url).to_s which will create a string something like GET some_url headers: some_headers. With this I don't need to waste time with MiTM apps and can see the conversion is correct.
Second, I'd like to build a request without executing it. How can I do this? I couldn't find it in your docs/code. The reason is I need to create a signature token based on the request headers + body (it's for AWS). Having this ability would greatly simplify coding.
# (pseudo code for idea - ignore syntax correctness)# currentheaders={some: values}payload=somethingcontent_size=payload.sizeuri=some_url_with_paramssignature=calculate_signature(headers.merge(content-length: content_size),payload,host_uri,params)res=HTTP.headers(headers.merge(Authorization: signature).get(uri)# my wishrequest=HTTP.headers(some: values).build_request(:get,uri,{body: payload})response=request.headers(Authorization: calculate_signature(request)).run
Logging interactions will be possible soon - I'm gonna find time next week to merge down outstanding PRs including logging one.
I like the proposal of build_request in fact I was thinking about that lately, as I needed the same for myself. Thus I'm totally open for PRs or will do that myself once will have some spare moments.
Activity
ixti commentedon Jul 21, 2017
Logging interactions will be possible soon - I'm gonna find time next week to merge down outstanding PRs including logging one.
I like the proposal of
build_requestin fact I was thinking about that lately, as I needed the same for myself. Thus I'm totally open for PRs or will do that myself once will have some spare moments.rwehresmann commentedon Apr 17, 2018
Any news about that?
tycooon commentedon Apr 17, 2018
HTTP::Client#build_requestmethod has been added to master recently (see https://github.com/httprb/http/pull/458/files).rwehresmann commentedon Apr 17, 2018
The example of the issue should work? I'm trying:
tycooon commentedon Apr 17, 2018
Are you sure that you are using the version from master? It's not released on rubygems I guess.
rwehresmann commentedon Apr 17, 2018
You're right, I didn't noticed that It wasn't in rubygems (: Tks!
janko commentedon Nov 18, 2018
This has been implemented in #458.