execute() public method

public execute ( ) : ConfigureMediaResponse
return Instagram\API\Response\ConfigureMediaResponse
 /**
  *
  * Post Photo to Timeline
  *
  * @param string $path File path of Photo to Post
  * @param string $caption Caption for this Photo
  * @return API\Response\ConfigureMediaResponse
  * @throws Exception
  */
 public function postPhoto($path, $caption = null)
 {
     if (!$this->isLoggedIn()) {
         throw new InstagramException("You must be logged in to call postPhoto().");
     }
     $request = new PhotoUploadRequest($this, $path);
     $response = $request->execute();
     if (!$response->isOk()) {
         throw new InstagramException(sprintf("Failed to Upload Photo: [%s] %s", $response->getStatus(), $response->getMessage()));
     }
     $request = new ConfigureMediaRequest($this, $response->getUploadId(), $path, $caption);
     $response = $request->execute();
     if (!$response->isOk()) {
         throw new InstagramException(sprintf("Failed to Configure Media: [%s] %s", $response->getStatus(), $response->getMessage()));
     }
     return $response;
 }