Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

reverse order of setting body and type on request in _request() #598

Closed
wants to merge 1 commit into from

1 participant

@omeryar

having the body set before the type meant the body was encoded as html no matter what the type actually is.

@omeryar omeryar Set request type before setting body
having the body set before the type meant the body was encoded as html no matter what the type actually is.
ae99c5c
@omeryar omeryar closed this
@omeryar

resubmitted on dev: #599

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 27, 2012
  1. @omeryar

    Set request type before setting body

    omeryar authored
    having the body set before the type meant the body was encoded as html no matter what the type actually is.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  net/http/Service.php
View
2  net/http/Service.php
@@ -216,8 +216,8 @@ protected function _request($method, $path, $data, $options) {
$request->method = $method = strtoupper($method);
$hasBody = in_array($method, array('POST', 'PUT'));
+ $hasBody ? $request->type($options['type']) : null;
$hasBody ? $request->body($data) : $request->query = $data;
- $hasBody ? $request->type($options['type']) : null;
return $request;
}
}
Something went wrong with that request. Please try again.