try {
conn.setRequestMethod("PUT");
- conn.setRequestProperty("Content-Type", "application/json");
} catch (ProtocolException e) {
shutdownConnection(conn);
throw new DocumentStoreOperationException("Failed to set HTTP request method to PUT.", e);
try {
conn.setRequestMethod("PUT");
- conn.setRequestProperty("Content-Type", "application/json");
} catch (ProtocolException e) {
shutdownConnection(conn);
throw new DocumentStoreOperationException("Failed to set HTTP request method to PUT.", e);
private void attachDocument(HttpURLConnection conn, DocumentStoreDataEntity doc)
throws DocumentStoreOperationException {
- conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("Connection", "Close");
attachContent(conn, doc.getContentInJson());
}
try {
conn.setRequestMethod("PUT");
- conn.setRequestProperty("Content-Type", "application/json");
} catch (ProtocolException e) {
shutdownConnection(conn);
throw new DocumentStoreOperationException("Failed to set HTTP request method to PUT.", e);
try {
conn.setRequestMethod("POST");
- conn.setRequestProperty("Content-Type", "application/json");
} catch (ProtocolException e) {
shutdownConnection(conn);
throw new DocumentStoreOperationException("Failed to set HTTP request method to POST.", e);
try {
conn.setRequestMethod("POST");
- conn.setRequestProperty("Content-Type", "application/json");
} catch (ProtocolException e) {
shutdownConnection(conn);
throw new DocumentStoreOperationException("Failed to set HTTP request method to POST.", e);
try {
conn = (HttpURLConnection) url.openConnection();
+ conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
} catch (IOException e) {
shutdownConnection(conn);