/**
  * @param $resp
  *
  * @return mixed
  */
 public static function getPollURL($resp)
 {
     $headers = NetworkUtils::getHeaders($resp);
     return $headers['Location'];
 }
 /**
  * @param $resp
  * @param $responseFormat
  *
  * @return object
  *
  * @throws BadJSONException
  */
 public static function parseResp($resp, $responseFormat)
 {
     if ($responseFormat == 'json') {
         $resp = NetworkUtils::getJSONStr($resp);
         $jsonObj = json_decode($resp);
         $respObj = array();
         $respObj['parsed'] = $jsonObj;
         return (object) $respObj;
     } else {
         if ($responseFormat == 'xml') {
             // TODO: handle XML
         }
     }
 }