Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.

Commit 2675feb

Browse files
author
Hideki Itakura
committed
Merge pull request #823 from couchbase/feature/issue_1110_router_contentType
Set content-type in unit-test request header
2 parents ad72c64 + 5e93cd0 commit 2675feb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/androidTest/java/com/couchbase/lite/LiteTestCaseWithDB.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ protected URLConnection sendRequest(String method, String path,
355355
try {
356356
URL url = new URL("cblite://" + path);
357357
URLConnection conn = (URLConnection) url.openConnection();
358+
conn.setRequestProperty("Content-Type", "application/json");
358359
conn.setDoOutput(true);
359360
conn.setRequestMethod(method);
360361
if (headers != null) {
@@ -420,6 +421,7 @@ protected Object parseJSONResponse(URLConnection conn) {
420421
protected Object sendBody(String method, String path, Object bodyObj,
421422
int expectedStatus, Object expectedResult) {
422423
URLConnection conn = sendRequest(method, path, null, bodyObj);
424+
conn.setRequestProperty("Content-Type", "application/json");
423425
Object result = parseJSONResponse(conn);
424426
Log.v(TAG, "%s %s --> %d", method, path, conn.getResponseCode());
425427
Assert.assertEquals(expectedStatus, conn.getResponseCode());

0 commit comments

Comments
 (0)