On 10/24/13 10:06 AM, Scott Smith wrote:
> In lib/Pmp/Sdk/CollectionDocJson.php:
>
>> @@ -178,6 +198,42 @@ private function getDocument($uri) {
>>      }
>>
>>      /**
>> +     * Does a DELETE operation on the given URI and returns true on success
>> +     * @param $uri
>> +     *    the URI to use in the request
>> +     * @return true on success
>> +     * @throws Exception
>> +     */
>> +    private function deleteDocument($uri) {
>> +        $request = new Request();
>> +
>> +        // DELETE request needs an authorization header with given access token
>> +        $accessToken = $this->getAccessToken();
>> +        $response = $request->header('Authorization', 'Bearer ' . $accessToken)
>
> That will likely require some refactoring. The other API calls in here
> do the same as this. Although I do agree that we should get "Bearer"
> from the token response instead of hard coding it here. We should do the
> same in the other methods in this class too.
>

FWIW, I agree, and the Perl SDK already does this (gets the 'Bearer' 
from the response):

https://github.com/APMG/pmp-sdk-perl/blob/master/lib/Net/PMP/Client.pm#L328

I was just following the convention already established in the PHP version.


-- 
Peter Karman
651.228.4972 (o)  651.208.6116 (m)  peter.karman.apm (skype)
Minnesota Public Radio | American Public Media