public byte[] makePhotosServicePostRequest(
      @NotNull final String url, @NotNull final byte[] requestData)
      throws IOException, CopyExceptionWithFailureReason {
    byte[] responseData = null;
    try {
      final String responseString = sendPostRequest(url, requestData);
      responseData = responseString.getBytes(StandardCharsets.ISO_8859_1);
    } catch (CopyExceptionWithFailureReason e) {
      if (e instanceof UnconfirmedUserException
          || e instanceof PermissionDeniedException) {
        this.authData = refreshTokens(authData, appCredentials, monitor);
        final String responseString = sendPostRequest(url, requestData);
        responseData = responseString.getBytes(StandardCharsets.ISO_8859_1);
      } else {
        throw e;
      }
    }
    return responseData;
  }
An interface that is synonymous to HTTP client to interact with the Apple Photos APIs.
extensions/data-transfer/portability-data-transfer-apple/src/main/java/org/datatransferproject/datatransfer/apple/photos/AppleMediaInterface.java