lib/Segment/Consumer/Socket.php
private function parseResponse($res) {
    $contents = explode("\n", $res);

    // Response comes back as HTTP/1.1 200 OK
    // Final line contains HTTP response.
    $status = explode(" ", $contents[0], 3);
    $result = $contents[count($contents) - 1];

    return array(
      "status"  => isset($status[1]) ? $status[1] : null,
      "message" => $result
    );
  }
private function parseResponse($res) {
    $contents = explode("\n", $res);

    // Response comes back as HTTP/1.1 200 OK
    // Final line contains HTTP response.
    $status = explode(" ", $contents[0], 3);
    $result = $contents[count($contents) - 1];

    return array(
      "status"  => isset($status[1]) ? $status[1] : null,
      "message" => $result
    );
  }
private function parseResponse ( $ res ) { $ contents = explode ( "\n" , $ res ) ; // Response comes back as HTTP/1.1 200 OK // Final line contains HTTP response. $ status = explode ( " " , $ contents [ 0 ] , 3 ) ; $ result = $ contents [ count ( $ contents ) - 1 ] ; return array ( "status" => isset ( $ status [ 1 ] ) ? $ status [ 1 ] : null , "message" => $ result ) ; }
Parse our response from the server, check header and body.
@param  string $res
@return array
string $status  HTTP code, e.g. "200"
string $message JSON response from the api
Parse our response from the server check header and body .