-
Notifications
You must be signed in to change notification settings - Fork 78
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
Update the Request object with sensible defaults and access methods #13
Labels
status: help wanted
requesting help from the community
type: community enhancement
feature request not on Twilio's roadmap
Comments
thinkingserious
added
type: community enhancement
feature request not on Twilio's roadmap
status: help wanted
requesting help from the community
labels
Sep 16, 2016
diegoc-am
added a commit
to diegoc-am/java-http-client
that referenced
this issue
Oct 5, 2016
Hello, submitted a PR, what I'm not sure about is if we want to make all the variables in the Request class private and have setters and getters. Only updated the maps |
Hi @belfazt, I've added some comments to the PR. Thanks! I would suggest we make all the variables private and have setters and getters. |
diegoc-am
added a commit
to diegoc-am/java-http-client
that referenced
this issue
Oct 6, 2016
diegoc-am
added a commit
to diegoc-am/java-http-client
that referenced
this issue
Oct 6, 2016
Hi @thinkingserious, I think I got to what you wanted |
thinkingserious
added a commit
that referenced
this issue
Oct 7, 2016
…-default-13 Update the request object with sensible defaults and access methods, #13
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
status: help wanted
requesting help from the community
type: community enhancement
feature request not on Twilio's roadmap
Issue Summary
In the Request we have:
set to null when the object gets instantiated.
This could definitely cause JAVA developer errors as they might assume the headers map to be at least instantiated and empty.
In fact in this example:
The user is forced to instantiate a new one and assign it while the developer could simply:
request.headers.put("Authorization","Bearer YOUR_API_KEY");
When playing with beans (such as Request), if you can avoid referencing externally complex objects it is better. In fact, I would suggest you to turn them private (or protected), add getters and setters, initialize them, and even make them final.
The text was updated successfully, but these errors were encountered: