-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple requests #21
Comments
@g4s8/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot! |
@llorllale I was actually looking how to do a request and it turns out I need to construct the http request using strings. Having something like here would make it much easier. |
@g4s8 I think we should recommend our users to use those request building objects from Takes Framework. Reimplementing them here would be silly, I think. |
@llorllale so this could be about extending the documentation (README.md) with example usage (replacing the JoinedText example with something less bare bones and more abstract). |
@yegor256 you meant that |
@yegor256 why isn't Takes included in the list of competitors? |
@llorllale because it doesn't know how to make HTTP requests. It can only build them in text form. |
@yegor256 I think you meant
But I believe the design of |
@llorllale I meant Takes, not jcabi-http |
I think then |
@llorllale well, not a bad idea, but will require a lot of refactoring and class moving... |
@yegor256 |
@g4s8 why did you leave out |
@yegor256 @g4s8 tell me what you think: new HtResponse(
new HtWire("host", port),
new RqHeaders(
new IterableOf<>(
"Host: host:port",
"Accept: */*"
),
new RqBase(
"GET", "/some/resource",
)
)
) All requests would still be of type With these decorators, we will basically be splicing and joining several What we would need:
Thoughts |
@llorllale I like the code snippet above, but I didn't understand the text beneath. We already have everything that we need for this code. What else is needed and what is your question? |
In my example above, we have two requests - A Therefore we need to join all those requests/inputs into a single one and send it via the wire. My question was if you guys accept this solution? |
@llorllale I didn't understand this:
|
@yegor256 the requirement is for providing "simple requests", not necessarily copy request objects from Takes. Here is my example again with the new HtResponse(
new HtWire("host", port),
new HtrHeaders(
new IterableOf<>(
"Host: host:port",
"Accept: */*"
),
new HtrBase(
"GET", "/some/resource",
)
)
) This |
@g4s8 @llorllale @yegor256 for the record, there are such simple request objects already emerging in the test code base of cactoos-http, see #79. Just noting that here so that they are merged with whatever solution is found in this issue :) |
I think there should be some simple request objects, like:
The text was updated successfully, but these errors were encountered: