-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Response extension functions #65
Comments
@rybalkinsd I guess the challenge is in how the API should look when we have to deal with different data types in the response. From a high level I guess we could categorise types under :
Thoughts? |
m/b it's better to allow interaction without There are two big cases.
|
for example Fuel has |
Here is a reference how http4k acts. Our goal is to analyze their experience and provide the most fluent and easiest DSL as possible |
@rybalkinsd I took a look at what Fuel provides. Correct me if I don't understand this. Here's a rough idea.
I understand this isn't a very DSL based approach, but its allows easier access since the user does not need to be concerned with anything(Request, Response, Result) unlike even what Fuel provides with |
@gokulchandra looks good for me. inline fun Response.asString(): String(?) = body()?.string()
inline fun Response.asJson() ... The only thing we didn't discuss yet - |
I should have Draft PR for this issue over the next 2 days. 👍 |
Please also have a look at my latest commits, there is a bit more developed upload dsl idea together with multipart |
Using #82 to work on this. |
Response
is rather verbose, especially accessing body content.Need to observe other http clients and figure out how dsl approach can serve users for clear response consumption.
Previously EagerResponse was introduced, however it's usage is also rather complex
The text was updated successfully, but these errors were encountered: