forked from sendgrid/java-http-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResponse.java
More file actions
35 lines (29 loc) · 676 Bytes
/
Response.java
File metadata and controls
35 lines (29 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.sendgrid;
import java.util.Map;
/**
* Class Response provides a standard interface to an API's response.
*/
public class Response {
public int statusCode;
public String body;
public Map<String,String> headers;
/**
* Set the API's response.
*/
public Response(int statusCode, String responseBody, Map<String,String> responseHeaders) {
this.statusCode = statusCode;
this.body = responseBody;
this.headers = responseHeaders;
}
public Response() {
this.reset();
}
/**
* Place the object into an empty state.
*/
public void reset() {
this.statusCode = 0;
this.body = "";
this.headers = null;
}
}