Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added getBinary so it is possible to access raw binary data in the re…

…quest body without it being modified by the utf-8 cleaner
  • Loading branch information...
commit 7c2f919993f5ccb04a0fa1bf54e657fadd6ceed0 1 parent 4e2c0d4
@rikh42 authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 http/RequestParams.php
View
18 http/RequestParams.php
@@ -122,6 +122,24 @@ public function get($name, $default='')
/**
+ * If the content is binary, this will return the raw content, unmodified.
+ * Use with care and attention.
+ * @param $name
+ * @param null $default
+ * @return null
+ */
+ public function getBinary($name, $default=null)
+ {
+ if (!array_key_exists($name, $this->all)) {
+ return $default;
+ }
+
+ // return the raw, unmodified content - here be dragons...
+ return $this->all[$name];
+ }
+
+
+ /**
* Returns a bool of true or false from the value
* @param $name
* @param bool $default
Please sign in to comment.
Something went wrong with that request. Please try again.