Skip to content

Ading a sync-ed variant of "HttpRequest.send"#10

Open
3Nigma wants to merge 4 commits intokodart:masterfrom
3Nigma:master
Open

Ading a sync-ed variant of "HttpRequest.send"#10
3Nigma wants to merge 4 commits intokodart:masterfrom
3Nigma:master

Conversation

@3Nigma
Copy link
Copy Markdown

@3Nigma 3Nigma commented Jul 2, 2014

Hi all,
Thank you for taking the time to review this. I present to you 2 modifications that aided me using Httpzoid in my project:

  • I've added a synchronized variant of the "HttpRequest.send" method. Maybe, as it was my case, sometimes a synchronized way of doing REST requests is desired. The previous "send" method has been refactored into "asyncSend" while the current "send" does things in a sync manner.
  • Also, HttpResponse has been converted to an interface as it should be. This allows more flexibility in the "HttpRequest.handler" method call and feels "a little bit more right".

[features not present in this pull request] As a side note, I've also implemented my own "HttpSerializer" that processes JSON using a GsonBuilder factory reference. This allows for custom JSON data serialization via the "GsonBuilder.registerTypeAdapter". To make this possible, I've also made a custom "HttpFactory" that ties everything together. Maybe it's a good thing, I don't know, but it helped me so maybe it can also help others.

That's it for now,
Thank you for the library, it's grait!,
Vic

Victor ADĂSCĂLIȚEI and others added 4 commits July 2, 2014 21:46
… the "HttpUrlonnectionRequest" implementation. Transformed the "ResponseHandler" into an interface so that it becomes easily to write "<Http instance>. [...] .handler(this).send()" which makes the code more readable.
… the "HttpUrlConnectionRequest" implementation. Transformed the "ResponseHandler" into an interface so that it becomes easily to write "<Http instance>. [...] .handler(this).send()" which makes the code more readable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant