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
    );
  }