Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ protected Response<S> perform(final Request<R, S> request) {
final HttpURLConnection connection = newURLConnection(request.getHttpMethod(), request.getUrl());
try {
connection.setDoInput(true);
final boolean isPOST = HttpMethod.POST.equals(request.getHttpMethod());
connection.setDoOutput(isPOST);
final boolean isPostOrPut = HttpMethod.POST.equals(request.getHttpMethod()) || HttpMethod.PUT.equals(request.getHttpMethod();
connection.setDoOutput(isPostOrPut);

// Basic HTTP Authentication
if (Objects.nonNull(this.mBasicHttpAuthentication)) {
Expand All @@ -415,7 +415,7 @@ protected Response<S> perform(final Request<R, S> request) {
}

// If is a POST:
if (isPOST) {
if (isPostOrPut) {
// If exists parameters:
final String parameters = request.getStringParameters();
if (Objects.nonNull(parameters)) {
Expand Down Expand Up @@ -601,6 +601,39 @@ public synchronized final void post(final String url, final R body, final Parame
this.send(HttpMethod.POST, url, body, parameters, properties);
}

/**
*
* @param url
*/
public synchronized final void put(final String url) {
this.put(url, mBody,
this.getValidParameters(),
this.getValidProperties());
}

/**
* @param url
* @param body
* @param parameters
*/
public synchronized final void put(final String url, final R body, final Parameter... parameters) {

this.put(url, body, (Objects.isNullOrEmpty(parameters) ? this.getValidParameters() : parameters),
this.getValidProperties());

}

/**
*
* @param url
* @param body
* @param parameters
* @param properties
*/
public synchronized final void put(final String url, final R body, final Parameter[] parameters, final Property[] properties) {
this.send(HttpMethod.PUT, url, body, parameters, properties);
}

/**
*
* @param url
Expand Down