1 package com.foxinmy.weixin4j.http;
2
3 import java.net.URI;
4
5 import com.foxinmy.weixin4j.http.entity.HttpEntity;
6
7
8
9
10
11
12
13
14
15
16 public class HttpRequest implements HttpMessage {
17
18
19
20
21
22 private final HttpMethod method;
23
24
25
26
27
28
29 private final URI uri;
30
31
32
33 private HttpEntity entity;
34
35
36
37 private HttpHeaders headers;
38
39 public HttpRequest(HttpMethod method, URI uri) {
40 this.method = method;
41 this.uri = uri;
42 }
43
44 public HttpRequest(HttpMethod method, String url) {
45 this(method, URI.create(url));
46 }
47
48 public HttpMethod getMethod() {
49 return method;
50 }
51
52 public URI getURI() {
53 return uri;
54 }
55
56 public HttpEntity getEntity() {
57 return entity;
58 }
59
60 public void setEntity(HttpEntity entity) {
61 this.entity = entity;
62 }
63
64 public void setHeaders(HttpHeaders headers) {
65 this.headers = headers;
66 }
67
68 @Override
69 public HttpHeaders getHeaders() {
70 return headers;
71 }
72 }