source: josm/trunk/src/oauth/signpost/http/HttpRequest.java@ 9514

Last change on this file since 9514 was 4231, checked in by stoecker, 13 years ago

add signpost and metadata extractor code to repository directly

File size: 1.2 KB
Line 
1package oauth.signpost.http;
2
3import java.io.IOException;
4import java.io.InputStream;
5import java.util.Map;
6
7import oauth.signpost.OAuthConsumer;
8import 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 */
20public 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}
Note: See TracBrowser for help on using the repository browser.