@@ -520,90 +520,6 @@ protected function _get( $endpoint, array $query_params = array() ) {
520520
521521 } // _get
522522
523- /**
524- * Performs a POST request, isolates caller from Apiexceptions
525- *
526- * @param string $endpoint just the segment of the API the request
527- * @param array $query_params anything additional to add to the query string, in key => value form
528- *
529- * @return string|bool response body on success, false on failure
530- */
531- protected function _post ( $ endpoint , array $ query_params = array (), $ post_body = array (), $ curl_params = array () ) {
532-
533- $ full_url = $ this ->_makeFullURL ( $ endpoint , $ query_params );
534-
535- try {
536- return $ this ->_executeRequest ( 'POST ' , $ full_url , $ post_body , $ curl_params );
537- } // try
538-
539- catch ( ApiException $ e ) {
540-
541- if ( $ this ->_debug ) {
542- echo ( __CLASS__ . ":: " . __LINE__ . ": " . $ e ->getMessage () );
543- }
544-
545- } // catch ApiException
546-
547- return false ;
548-
549- } // _post
550-
551- /**
552- * Performs a PUT request, isolates caller from Apiexceptions
553- *
554- * @param string $endpoint just the segment of the API the request
555- * @param array $query_params anything additional to add to the query string, in key => value form
556- *
557- * @return string|bool response body on success, false on failure
558- */
559- protected function _put ( $ endpoint , array $ query_params = array (), $ put_body = array (), $ curl_params = array () ) {
560-
561- $ full_url = $ this ->_makeFullURL ( $ endpoint , $ query_params );
562-
563- try {
564- return $ this ->_executeRequest ( 'PUT ' , $ full_url , $ put_body , $ curl_params );
565- } // try
566-
567- catch ( ApiException $ e ) {
568-
569- if ( $ this ->_debug ) {
570- echo ( __CLASS__ . ":: " . __LINE__ . ": " . $ e ->getMessage () );
571- }
572-
573- } // catch ApiException
574-
575- return false ;
576-
577- } // _put
578-
579- /**
580- * Performs a DELETE request, isolates caller from Apiexceptions
581- *
582- * @param string $endpoint just the segment of the API the request
583- * @param array $query_params anything additional to add to the query string, in key => value form
584- *
585- * @return string|bool response body on success, false on failure
586- */
587- protected function _delete ( $ endpoint , array $ query_params = array (), $ delete_body = array (), $ curl_params = array () ) {
588-
589- $ full_url = $ this ->_makeFullURL ( $ endpoint , $ query_params );
590-
591- try {
592- return $ this ->_executeRequest ( 'DELETE ' , $ full_url , $ delete_body , $ curl_params );
593- } // try
594-
595- catch ( ApiException $ e ) {
596-
597- if ( $ this ->_debug ) {
598- echo ( __CLASS__ . ":: " . __LINE__ . ": " . $ e ->getMessage () );
599- }
600-
601- } // catch ApiException
602-
603- return false ;
604-
605- } // _delete
606-
607523 /**
608524 * Generates a fully-quality API url, with $endpoint + $query_params, automatically adds in app's key
609525 *
@@ -613,7 +529,7 @@ protected function _delete( $endpoint, array $query_params = array(), $delete_bo
613529 protected function _makeFullURL ( $ endpoint , array $ query_params = array () ) {
614530
615531 $ query_string = '? ' . http_build_query ( $ query_params );
616- $ full_url = $ this -> _api_root . $ endpoint . $ query_string ;
532+ $ full_url = self :: API_ROOT . $ endpoint . $ query_string ;
617533
618534 return $ full_url ;
619535
0 commit comments