Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Data for PATCH requests in net\http\Service should be encoded in the request body. Fixes #647. #648

Merged
merged 1 commit into from

2 participants

@ppadron

No description provided.

@nateabele nateabele merged commit b5e4c87 into UnionOfRAD:dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 18, 2012
  1. @ppadron
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +2 −2 net/http/Service.php
  2. +1 −0  tests/cases/net/http/ServiceTest.php
View
4 net/http/Service.php
@@ -222,7 +222,7 @@ public function send($method, $path = null, $data = array(), array $options = ar
* @param string $data
* @param string $options
* @return object Returns an instance of `http\Request`, configured with an HTTP method, query
- * string or POST/PUT data, and URL.
+ * string or POST/PUT/PATCH data, and URL.
*/
protected function _request($method, $path, $data, $options) {
$defaults = array('type' => 'form');
@@ -232,7 +232,7 @@ protected function _request($method, $path, $data, $options) {
$request->path = str_replace('//', '/', "{$request->path}{$path}");
$request->method = $method = strtoupper($method);
- $hasBody = in_array($method, array('POST', 'PUT'));
+ $hasBody = in_array($method, array('POST', 'PUT', 'PATCH'));
$hasBody ? $request->type($options['type']) : null;
$hasBody ? $request->body($data) : $request->query = $data;
return $request;
View
1  tests/cases/net/http/ServiceTest.php
@@ -263,6 +263,7 @@ public function testMagicMethod() {
$result = $http->last->request;
$this->assertEqual('PATCH', $result->method);
$this->assertEqual('lithium\net\http\Response', get_class($response));
+ $this->assertEqual('someData=someValue', $result->body());
}
public function testDigestAuth() {
Something went wrong with that request. Please try again.