Lines Matching defs:data

60     // what we use as boundary on multipart/form-data posts
115 * @param array $data Associative array of parameters
121 public function dget($url,$data,$sloppy304=false){
127 $url .= $this->postEncode($data);
137 * @param array $data Associative array of parameters
141 public function post($url,$data){
142 if(!$this->sendRequest($url,$data,'POST')) return false;
153 * Post data should be passed as associative array. When passed as string it will be
157 * @param mixed $data - the post data either as array or raw data
164 public function sendRequest($url,$data='',$method='GET'){
171 // save unencoded data for recursive call
172 $unencodedData = $data;
221 if(is_array($data)){
226 case 'multipart/form-data':
227 $headers['Content-Type'] = 'multipart/form-data; boundary=' . $this->boundary;
228 $data = $this->postMultipartEncode($data);
232 $data = $this->postEncode($data);
236 $data = ''; //no data allowed on GET requests
239 $contentlength = strlen($data);
310 $request .= $data;
571 * Safely write data to a socket
574 * @param string $data The data to write
580 protected function sendData($socket, $data, $message) {
582 $towrite = strlen($data);
603 $nbytes = fwrite($socket, substr($data,$written,4096));
611 * Safely read data from a socket
827 * Encode data for posting
831 * @param array $data
834 protected function postEncode($data){
835 return http_build_query($data,'','&');
839 * Encode data for posting using multipart encoding
844 * @param array $data
847 protected function postMultipartEncode($data){
850 foreach($data as $key => $val){
853 $out .= 'Content-Disposition: form-data; name="'.urlencode($key).'"'.HTTP_NL;
858 $out .= 'Content-Disposition: form-data; name="'.urlencode($key).'"';