Setting Content-Type and sending request for SnapshotPushRequest.

This commit is contained in:
Winston Li 2014-11-16 20:43:33 +00:00
parent 375916678d
commit 87bd7e6ff4
2 changed files with 2 additions and 2 deletions

View file

@ -45,7 +45,7 @@ public class WriteLatexAPI implements WriteLatexDataSource {
@Override
public void putDirectoryContentsToProjectWithName(String projectName, RawDirectoryContents directoryContents, String remoteAddr) throws SnapshotPostException, IOException, FailedConnectionException {
CandidateSnapshot candidate = dataModel.createCandidateSnapshotFromProjectWithContents(projectName, directoryContents, remoteAddr);
new SnapshotPushRequest(candidate);
new SnapshotPushRequest(candidate).request();
throw new SnapshotPostException() {
@Override

View file

@ -67,7 +67,7 @@ public abstract class Request<T extends Result> {
}
private void performPostRequest() {
request(new AsyncHttpClient().preparePost(url).setBody(getPostBody()));
request(new AsyncHttpClient().preparePost(url).setBody(getPostBody()).setHeader("Content-Type", "application/json"));
}
private void request(BoundRequestBuilder boundRequestBuilder) {