-
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 #15
Update the request object with sensible defaults and access methods, #13 #15
Conversation
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")); |
There was a problem hiding this comment.
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"));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
queryParams.put("offset", "0"); | ||
request.queryParams = queryParams; | ||
request.getQueryParams().put("limit", "100"); | ||
request.getQueryParams().put("offset", "0"); |
There was a problem hiding this comment.
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");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -39,7 +35,7 @@ public static void main(String[] args) throws IOException { | |||
} catch (IOException ex) { | |||
throw ex; | |||
} | |||
request.queryParams = null; | |||
request.getQueryParams().clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about request.clearQueryParams();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Will update it later tonight! Thanks for the feedback |
…//github.com/belfazt/java-http-client into make-request-object-have-sensible-default-13
fixed! |
…th sensible defaults and access methods
No description provided.