Skip to content

Commit 7cff48d

Browse files
Merge pull request #162 from belfazt/update-java-http-client-dependency-to-4.0.0-issue-155
Update java http client dependency to 4.0.0 issue #155
2 parents 575b0f4 + a513999 commit 7cff48d

File tree

33 files changed

+3757
-4051
lines changed

33 files changed

+3757
-4051
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ public class Example {
102102
SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
103103
Request request = new Request();
104104
try {
105-
request.method = Method.POST;
106-
request.endpoint = "mail/send";
107-
request.body = mail.build();
105+
request.setMethod(Method.POST);
106+
request.setEndpoint("mail/send");
107+
request.setBody(mail.build());
108108
Response response = sg.api(request);
109-
System.out.println(response.statusCode);
110-
System.out.println(response.body);
111-
System.out.println(response.headers);
109+
System.out.println(response.getStatusCode());
110+
System.out.println(response.getBody());
111+
System.out.println(response.getHeaders());
112112
} catch (IOException ex) {
113113
throw ex;
114114
}
@@ -131,13 +131,13 @@ public class Example {
131131
try {
132132
SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
133133
Request request = new Request();
134-
request.method = Method.POST;
135-
request.endpoint = "mail/send";
136-
request.body = "{\"personalizations\":[{\"to\":[{\"email\":\"[email protected]\"}],\"subject\":\"Hello World from the SendGrid Java Library!\"}],\"from\":{\"email\":\"[email protected]\"},\"content\":[{\"type\":\"text/plain\",\"value\": \"Hello, Email!\"}]}";
134+
request.setMethod(Method.POST);
135+
request.setEndpoint("mail/send");
136+
request.setBody("{\"personalizations\":[{\"to\":[{\"email\":\"[email protected]\"}],\"subject\":\"Hello World from the SendGrid Java Library!\"}],\"from\":{\"email\":\"[email protected]\"},\"content\":[{\"type\":\"text/plain\",\"value\": \"Hello, Email!\"}]}");
137137
Response response = sg.api(request);
138-
System.out.println(response.statusCode);
139-
System.out.println(response.body);
140-
System.out.println(response.headers);
138+
System.out.println(response.getStatusCode());
139+
System.out.println(response.getBody());
140+
System.out.println(response.getHeaders());
141141
} catch (IOException ex) {
142142
throw ex;
143143
}
@@ -156,12 +156,12 @@ public class Example {
156156
SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
157157
try {
158158
Request request = new Request();
159-
request.method = Method.GET;
160-
request.endpoint = "api_keys";
159+
request.setMethod(Method.GET);
160+
request.setEndpoint("api_keys");
161161
Response response = sg.api(request);
162-
System.out.println(response.statusCode);
163-
System.out.println(response.body);
164-
System.out.println(response.headers);
162+
System.out.println(response.getStatusCode());
163+
System.out.println(response.getBody());
164+
System.out.println(response.getHeaders());
165165
} catch (IOException ex) {
166166
throw ex;
167167
}

0 commit comments

Comments
 (0)