Skip to content

Update the request object with sensible defaults and access methods, #13#15

Merged
thinkingserious merged 4 commits intosendgrid:masterfrom
diegoc-am:make-request-object-have-sensible-default-13
Oct 7, 2016
Merged

Update the request object with sensible defaults and access methods, #13#15
thinkingserious merged 4 commits intosendgrid:masterfrom
diegoc-am:make-request-object-have-sensible-default-13

Conversation

@diegoc-am
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread examples/Example.java Outdated
Map<String,String> requestHeaders = new HashMap<String, String>();
requestHeaders.put("Authorization", "Bearer " + System.getenv("SENDGRID_API_KEY"));
request.headers = requestHeaders;
request.getHeaders().put("Authorization", "Bearer " + System.getenv("SENDGRID_API_KEY"));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a setter here instead?

e.g. request.addHeader("Authorization", "Bearer " + System.getenv("SENDGRID_API_KEY"));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread examples/Example.java Outdated
queryParams.put("offset", "0");
request.queryParams = queryParams;
request.getQueryParams().put("limit", "100");
request.getQueryParams().put("offset", "0");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a setter here instead?

e.g. request.addQueryParam("offset", "0");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread examples/Example.java Outdated
throw ex;
}
request.queryParams = null;
request.getQueryParams().clear();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about request.clearQueryParams();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@diegoc-am
Copy link
Copy Markdown
Contributor Author

Will update it later tonight! Thanks for the feedback

@thinkingserious thinkingserious added type: community enhancement feature request not on Twilio's roadmap status: cla signed status: work in progress Twilio or the community is in the process of implementing labels Oct 5, 2016
@diegoc-am
Copy link
Copy Markdown
Contributor Author

fixed!

@thinkingserious thinkingserious merged commit 433326b into sendgrid:master Oct 7, 2016
thinkingserious added a commit that referenced this pull request Oct 7, 2016
@diegoc-am diegoc-am deleted the make-request-object-have-sensible-default-13 branch June 2, 2017 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: work in progress Twilio or the community is in the process of implementing type: community enhancement feature request not on Twilio's roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants