|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openjena.riot.web.HttpOp
public class HttpOp
Simplified HTTP operations; simplification means only supporting certain needed uses of HTTP. The expectation is that the simplified operations in this class can be used by other code to generate more application specific HTTP interactions (e.g. SPARQL queries).
For HTTP GET, the application supplies a URL, the accept header string, and a list of handlers to deal with different content type responses.
For HTTP POST, the application supplies a URL, content, the accept header string, and a list of handlers to deal with different content type responses, or no response is expected.
HttpNames, for HTTP related constants
,
WebContent, for content type name constants
Constructor Summary | |
---|---|
HttpOp()
|
Method Summary | |
---|---|
static void |
execHttpGet(String url,
String acceptHeader,
Map<String,HttpResponseHandler> handlers)
GET |
static void |
execHttpPost(String url,
org.apache.http.HttpEntity provider,
String acceptType,
Map<String,HttpResponseHandler> handlers)
POST with response body. |
static void |
execHttpPost(String url,
String contentType,
ContentProducer provider,
String acceptType,
Map<String,HttpResponseHandler> handlers)
POST with response body |
static void |
execHttpPost(String url,
String contentType,
InputStream input,
int length)
POST without response body. |
static void |
execHttpPost(String url,
String contentType,
InputStream input,
int length,
String acceptType,
Map<String,HttpResponseHandler> handlers)
POST with response body. |
static void |
execHttpPost(String url,
String contentType,
String content)
POST a string without response body. |
static void |
execHttpPost(String url,
String contentType,
String content,
String acceptType,
Map<String,HttpResponseHandler> handlers)
POST a string, expect a response body. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpOp()
Method Detail |
---|
public static void execHttpGet(String url, String acceptHeader, Map<String,HttpResponseHandler> handlers)
The acceptHeader string is any legal value for HTTP Accept: field.
The handlers are the set of content types (without charset), used to dispatch the response body for handling.
A Map entry of ("*",....) is used "no handler found".
HTTP responses 400 and 500 become exceptions.
public static void execHttpPost(String url, String contentType, String content)
Execute an HTTP POST, with the string as content.
No response content expected or processed.
public static void execHttpPost(String url, String contentType, InputStream input, int length)
Execute an HTTP POST, with the string as content.
No response content expected or processed.
public static void execHttpPost(String url, String contentType, String content, String acceptType, Map<String,HttpResponseHandler> handlers)
public static void execHttpPost(String url, String contentType, InputStream input, int length, String acceptType, Map<String,HttpResponseHandler> handlers)
public static void execHttpPost(String url, String contentType, ContentProducer provider, String acceptType, Map<String,HttpResponseHandler> handlers)
public static void execHttpPost(String url, org.apache.http.HttpEntity provider, String acceptType, Map<String,HttpResponseHandler> handlers)
The content for the POST body comes from the HttpEntity.
The response is handled bythe handler map, as per execHttpGet(String, String, Map)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |