Debian Codegraph @

signpost-core/src/main/java/oauth/signpost/http/HttpRequest.java

raw
1 package oauth.signpost.http;
2
3 import java.io.IOException;
4 import java.io.InputStream;
5 import java.util.Map;
6
7 import oauth.signpost.OAuthConsumer;
8 import oauth.signpost.basic.HttpURLConnectionRequestAdapter;
9
10 /**
11 * A concise description of an HTTP request. Contains methods to access all
12 * those parts of an HTTP request which Signpost needs to sign a message. If you
13 * want to extend Signpost to sign a different kind of HTTP request than those
14 * currently supported, you'll have to write an adapter which implements this
15 * interface and a custom {@link OAuthConsumer} which performs the wrapping.
16 *
17 * @see HttpURLConnectionRequestAdapter
18 * @author Matthias Kaeppler
19 */
20 public interface HttpRequest {
21
22 String getMethod();
23
24 String getRequestUrl();
25
26 void setRequestUrl(String url);
27
28 void setHeader(String name, String value);
29
30 String getHeader(String name);
31
32 Map<String, String> getAllHeaders();
33
34 InputStream getMessagePayload() throws IOException;
35
36 String getContentType();
37
38 /**
39 * Returns the wrapped request object, in case you must work directly on it.
40 *
41 * @return the wrapped request object
42 */
43 Object unwrap();
44 }