Свойство | Тип | Описание | |
---|---|---|---|
$csrfToken | string | ||
$filePathToUpload | string | ||
$httpClient | seregazhuk\PinterestBot\Api\Contracts\HttpClient | ||
$lastError | array | null | ||
$loggedIn | boolean | ||
$postFileData | string | ||
$requestHeaders | array | Common headers needed for every query. |
Метод | Описание | |
---|---|---|
__construct ( seregazhuk\PinterestBot\Api\Contracts\HttpClient $http ) | ||
autoLogin ( string $username ) : boolean | Load cookies for this username and check if it was logged in. | |
clearToken ( ) | Clear token information. | |
createQuery ( array $data = [], array $bookmarks = [] ) : string | Create request string. | |
createRequestData ( array $data = [], array $bookmarks = [] ) : array | ||
exec ( string $resourceUrl, string $postString = '' ) : string | Executes request to Pinterest API. | |
getHttpClient ( ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient | ||
getLastError ( ) : array | null | ||
isLoggedIn ( ) : boolean | Get current auth status. | |
login ( ) | Mark client as logged. | |
logout ( ) | Mark client as logged out. | |
setTokenFromCookies ( ) | Trying to get csrf token from cookies. | |
upload ( string $pathToFile, string $url ) : string |
Метод | Описание | |
---|---|---|
buildFilePostData ( string $delimiter ) | ||
getContentTypeHeader ( ) : array | If we are uploading file, we should build boundary form data. Otherwise it is simple urlencoded form. | |
getDefaultHttpHeaders ( ) : array | ||
getHttpHeaders ( ) : array | ||
makeHeadersForUpload ( ) : array |
public __construct ( seregazhuk\PinterestBot\Api\Contracts\HttpClient $http ) | ||
$http | seregazhuk\PinterestBot\Api\Contracts\HttpClient |
protected buildFilePostData ( string $delimiter ) | ||
$delimiter | string |
protected getContentTypeHeader ( ) : array | ||
Результат | array |
protected getDefaultHttpHeaders ( ) : array | ||
Результат | array |
public getHttpClient ( ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient | ||
Результат | seregazhuk\PinterestBot\Api\Contracts\HttpClient |
public isLoggedIn ( ) : boolean | ||
Результат | boolean |
public setTokenFromCookies ( ) |
protected HttpClient,seregazhuk\PinterestBot\Api\Contracts $httpClient | ||
Результат | seregazhuk\PinterestBot\Api\Contracts\HttpClient |
protected array $requestHeaders | ||
Результат | array |