Skip to content
This repository

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

Closed
wants to merge 1 commit into from

1 participant

Omer
Omer

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

Omer 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
Omer omeryar closed this
Omer

resubmitted on dev: #599

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jul 27, 2012
Omer 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
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  net/http/Service.php
2  net/http/Service.php
@@ -216,8 +216,8 @@ protected function _request($method, $path, $data, $options) {
216 216 $request->method = $method = strtoupper($method);
217 217
218 218 $hasBody = in_array($method, array('POST', 'PUT'));
  219 + $hasBody ? $request->type($options['type']) : null;
219 220 $hasBody ? $request->body($data) : $request->query = $data;
220   - $hasBody ? $request->type($options['type']) : null;
221 221 return $request;
222 222 }
223 223 }

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.