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

Add PATCH support for upload on Android #147

Merged
merged 1 commit into from
Oct 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ else if (value.equalsIgnoreCase("utf8"))
}
}

if(method.equalsIgnoreCase("post") || method.equalsIgnoreCase("put")) {
if(method.equalsIgnoreCase("post") || method.equalsIgnoreCase("put") || method.equalsIgnoreCase("patch")) {
String cType = getHeaderIgnoreCases(mheaders, "Content-Type").toLowerCase();

if(rawRequestBodyArray != null) {
Expand Down Expand Up @@ -281,7 +281,7 @@ else if(cType.isEmpty()) {
break;

case WithoutBody:
if(method.equalsIgnoreCase("POST") || method.equalsIgnoreCase("PUT"))
if(method.equalsIgnoreCase("post") || method.equalsIgnoreCase("put") || method.equalsIgnoreCase("patch"))
{
builder.method(method, RequestBody.create(null, new byte[0]));
}
Expand Down