Repository: burnash/gspread

Issue:
Client functions in v6.0.0 do not work - `HTTP Client Object has no attribute insert_permission`
**Important**: Please do not post usage questions here. 
To get a quick response, please ask a question on Stack Overflow using `gspread` tag.
See existing questions: https://stackoverflow.com/questions/tagged/gspread

---

**Describe the bug**
When we are sharing a spreadsheet there is an issue with Sharing since the HTTPClient doesn't have the insert_permission function.

**To Reproduce**
Steps to reproduce the behavior:
1. Create a Spreadsheet
2. Use the share function.

**Expected behavior**
We should be able to share stuff.


Discussion:

Patch:
diff --git a/gspread/client.py b/gspread/client.py
index 34666b0..0cb3150 100644
--- a/gspread/client.py
+++ b/gspread/client.py
@@ -12,7 +12,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union
 from google.auth.credentials import Credentials
 from requests import Response, Session
 
-from .exceptions import APIError, SpreadsheetNotFound, UnSupportedExportFormat
+from .exceptions import APIError, SpreadsheetNotFound
 from .http_client import HTTPClient, HTTPClientType, ParamsType
 from .spreadsheet import Spreadsheet
 from .urls import (
@@ -239,15 +239,7 @@ class Client:
         .. _ExportFormat: https://developers.google.com/drive/api/guides/ref-export-formats
         """
 
-        if format not in ExportFormat:
-            raise UnSupportedExportFormat
-
-        url = "{}/{}/export".format(DRIVE_FILES_API_V3_URL, file_id)
-
-        params: ParamsType = {"mimeType": format}
-
-        r = self.http_client.request("get", url, params=params)
-        return r.content
+        return self.http_client.export(file_id=file_id, format=format)
 
     def copy(
         self,
@@ -406,34 +398,14 @@ class Client:
 
         :param str file_id: a spreadsheet ID (aka file ID).
         """
-        url = "{}/{}/permissions".format(DRIVE_FILES_API_V3_URL, file_id)
-
-        params: ParamsType = {
-            "supportsAllDrives": True,
-            "fields": "nextPageToken,permissions",
-        }
-
-        token = ""
-
-        permissions = []
-
-        while token is not None:
-            if token:
-                params["pageToken"] = token
-
-            r = self.http_client.request("get", url, params=params).json()
-            permissions.extend(r["permissions"])
-
-            token = r.get("nextPageToken", None)
-
-        return permissions
+        return self.http_client.list_permissions(file_id)
 
     def insert_permission(
         self,
         file_id: str,
-        value: Optional[str],
-        perm_type: Optional[str],
-        role: Optional[str],
+        value: Optional[str] = None,
+        perm_type: Optional[str] = None,
+        role: Optional[str] = None,
         notify: bool = True,
         email_message: Optional[str] = None,
         with_link: bool = False,
@@ -442,7 +414,7 @@ class Client:
 
         :param str file_id: a spreadsheet ID (aka file ID).
         :param value: user or group e-mail address, domain name
-            or None for 'default' type.
+            or None for 'anyone' type.
         :type value: str, None
         :param str perm_type: (optional) The account type.
             Allowed values are: ``user``, ``group``, ``domain``, ``anyone``
@@ -478,29 +450,9 @@ class Client:
             )
 
         """
-
-        url = "{}/{}/permissions".format(DRIVE_FILES_API_V3_URL, file_id)
-        payload = {
-            "type": perm_type,
-            "role": role,
-            "withLink": with_link,
-        }
-        params: ParamsType = {
-            "supportsAllDrives": "true",
-        }
-
-        if perm_type == "domain":
-            payload["domain"] = value
-        elif perm_type in {"user", "group"}:
-            payload["emailAddress"] = value
-            params["sendNotificationEmail"] = notify
-            params["emailMessage"] = email_message
-        elif perm_type == "anyone":
-            pass
-        else:
-            raise ValueError("Invalid permission type: {}".format(perm_type))
-
-        return self.http_client.request("post", url, json=payload, params=params)
+        return self.http_client.insert_permission(
+            file_id, value, perm_type, role, notify, email_message, with_link
+        )
 
     def remove_permission(self, file_id: str, permission_id: str) -> None:
         """Deletes a permission from a file.
@@ -508,9 +460,4 @@ class Client:
         :param str file_id: a spreadsheet ID (aka file ID.)
         :param str permission_id: an ID for the permission.
         """
-        url = "{}/{}/permissions/{}".format(
-            DRIVE_FILES_API_V3_URL, file_id, permission_id
-        )
-
-        params: ParamsType = {"supportsAllDrives": True}
-        self.http_client.request("delete", url, params=params)
+        self.http_client.remove_permission(file_id, permission_id)
diff --git a/gspread/http_client.py b/gspread/http_client.py
index 551c5a8..1c99aa5 100644
--- a/gspread/http_client.py
+++ b/gspread/http_client.py
@@ -7,13 +7,24 @@ Google API.
 
 """
 from http import HTTPStatus
-from typing import IO, Any, List, Mapping, MutableMapping, Optional, Tuple, Type, Union
+from typing import (
+    IO,
+    Any,
+    Dict,
+    List,
+    Mapping,
+    MutableMapping,
+    Optional,
+    Tuple,
+    Type,
+    Union,
+)
 
 from google.auth.credentials import Credentials
 from google.auth.transport.requests import AuthorizedSession
 from requests import Response, Session
 
-from .exceptions import APIError
+from .exceptions import APIError, UnSupportedExportFormat
 from .urls import (
     DRIVE_FILES_API_V3_URL,
     SPREADSHEET_BATCH_UPDATE_URL,
@@ -26,7 +37,7 @@ from .urls import (
     SPREADSHEET_VALUES_CLEAR_URL,
     SPREADSHEET_VALUES_URL,
 )
-from .utils import convert_credentials, quote
+from .utils import ExportFormat, convert_credentials, quote
 
 ParamsType = MutableMapping[str, Optional[Union[str, int, bool, float, List[str]]]]
 
@@ -306,6 +317,153 @@ class HTTPClient:
 
         return res.json()
 
+    def export(self, file_id: str, format: str = ExportFormat.PDF) -> bytes:
+        """Export the spreadsheet in the given format.
+
+        :param str file_id: The key of the spreadsheet to export
+
+        :param str format: The format of the resulting file.
+            Possible values are:
+
+                * ``ExportFormat.PDF``
+                * ``ExportFormat.EXCEL``
+                * ``ExportFormat.CSV``
+                * ``ExportFormat.OPEN_OFFICE_SHEET``
+                * ``ExportFormat.TSV``
+                * ``ExportFormat.ZIPPED_HTML``
+
+            See `ExportFormat`_ in the Drive API.
+
+        :type format: :class:`~gspread.utils.ExportFormat`
+
+        :returns bytes: The content of the exported file.
+
+        .. _ExportFormat: https://developers.google.com/drive/api/guides/ref-export-formats
+        """
+
+        if format not in ExportFormat:
+            raise UnSupportedExportFormat
+
+        url = "{}/{}/export".format(DRIVE_FILES_API_V3_URL, file_id)
+
+        params: ParamsType = {"mimeType": format}
+
+        r = self.request("get", url, params=params)
+        return r.content
+
+    def insert_permission(
+        self,
+        file_id: str,
+        email_address: Optional[str],
+        perm_type: Optional[str],
+        role: Optional[str],
+        notify: bool = True,
+        email_message: Optional[str] = None,
+        with_link: bool = False,
+    ) -> Response:
+        """Creates a new permission for a file.
+
+        :param str file_id: a spreadsheet ID (aka file ID).
+        :param email_address: user or group e-mail address, domain name
+            or None for 'anyone' type.
+        :type email_address: str, None
+        :param str perm_type: (optional) The account type.
+            Allowed values are: ``user``, ``group``, ``domain``, ``anyone``
+        :param str role: (optional) The primary role for this user.
+            Allowed values are: ``owner``, ``writer``, ``reader``
+        :param bool notify: Whether to send an email to the target
+            user/domain. Default ``True``.
+        :param str email_message: (optional) An email message to be sent
+            if ``notify=True``.
+        :param bool with_link: Whether the link is required for this
+            permission to be active. Default ``False``.
+
+        :returns dict: the newly created permission
+
+        Examples::
+
+            # Give write permissions to otto@example.com
+
+            gc.insert_permission(
+                '0BmgG6nO_6dprnRRUWl1UFE',
+                'otto@example.org',
+                perm_type='user',
+                role='writer'
+            )
+
+            # Make the spreadsheet publicly readable
+
+            gc.insert_permission(
+                '0BmgG6nO_6dprnRRUWl1UFE',
+                None,
+                perm_type='anyone',
+                role='reader'
+            )
+
+        """
+        url = "{}/{}/permissions".format(DRIVE_FILES_API_V3_URL, file_id)
+        payload = {
+            "type": perm_type,
+            "role": role,
+            "withLink": with_link,
+        }
+        params: ParamsType = {
+            "supportsAllDrives": "true",
+        }
+
+        if perm_type == "domain":
+            payload["domain"] = email_address
+        elif perm_type in {"user", "group"}:
+            payload["emailAddress"] = email_address
+            params["sendNotificationEmail"] = notify
+            params["emailMessage"] = email_message
+        elif perm_type == "anyone":
+            pass
+        else:
+            raise ValueError("Invalid permission type: {}".format(perm_type))
+
+        return self.request("post", url, json=payload, params=params)
+
+    def list_permissions(self, file_id: str) -> List[Dict[str, Union[str, bool]]]:
+        """Retrieve a list of permissions for a file.
+
+        :param str file_id: a spreadsheet ID (aka file ID).
+        """
+        url = "{}/{}/permissions".format(DRIVE_FILES_API_V3_URL, file_id)
+
+        params: ParamsType = {
+            "supportsAllDrives": True,
+            "fields": "nextPageToken,permissions",
+        }
+
+        token = ""
+
+        permissions = []
+
+        while token is not None:
+            if token:
+                params["pageToken"] = token
+
+            r = self.request("get", url, params=params).json()
+            permissions.extend(r["permissions"])
+
+            token = r.get("nextPageToken", None)
+
+        return permissions
+
+    def remove_permission(self, file_id: str, permission_id: str) -> None:
+        """Deletes a permission from a file.
+
+        :param str file_id: a spreadsheet ID (aka file ID.)
+        :param str permission_id: an ID for the permission.
+        """
+        url = "{}/{}/permissions/{}".format(
+            DRIVE_FILES_API_V3_URL, file_id, permission_id
+        )
+
+        params: ParamsType = {"supportsAllDrives": True}
+        self.request("delete", url, params=params)
+
 
 class BackOffHTTPClient(HTTPClient):
     """BackoffClient is a gspread client with exponential
diff --git a/gspread/spreadsheet.py b/gspread/spreadsheet.py
index 6b33835..09715ff 100644
--- a/gspread/spreadsheet.py
+++ b/gspread/spreadsheet.py
@@ -457,9 +457,9 @@ class Spreadsheet:
     ):
         """Share the spreadsheet with other accounts.
 
-        :param value: user or group e-mail address, domain name
-                      or None for 'default' type.
-        :type value: str, None
+        :param email_address: user or group e-mail address, domain name
+                      or None for 'anyone' type.
+        :type email_address: str, None
         :param perm_type: The account type.
                Allowed values are: ``user``, ``group``, ``domain``,
                ``anyone``.
@@ -484,7 +484,7 @@ class Spreadsheet:
         """
         return self.client.insert_permission(
             self.id,
-            value=email_address,
+            email_address=email_address,
             perm_type=perm_type,
             role=role,
             notify=notify,


Test patch:
diff --git a/tests/cassettes/ClientTest.test_client_export_spreadsheet.json b/tests/cassettes/ClientTest.test_client_export_spreadsheet.json
new file mode 100644
index 0000000..7a96468
--- /dev/null
+++ b/tests/cassettes/ClientTest.test_client_export_spreadsheet.json
@@ -0,0 +1,461 @@
+{
+    "version": 1,
+    "interactions": [
+        {
+            "request": {
+                "method": "POST",
+                "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True",
+                "body": "{\"name\": \"Test ClientTest test_client_export_spreadsheet\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}",
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "Content-Length": [
+                        "113"
+                    ],
+                    "Content-Type": [
+                        "application/json"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 200,
+                    "message": "OK"
+                },
+                "headers": {
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:28 GMT"
+                    ],
+                    "Content-Type": [
+                        "application/json; charset=UTF-8"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "Expires": [
+                        "Mon, 01 Jan 1990 00:00:00 GMT"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Vary": [
+                        "Origin, X-Origin"
+                    ],
+                    "Pragma": [
+                        "no-cache"
+                    ],
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "Transfer-Encoding": [
+                        "chunked"
+                    ],
+                    "Cache-Control": [
+                        "no-cache, no-store, max-age=0, must-revalidate"
+                    ],
+                    "content-length": [
+                        "200"
+                    ]
+                },
+                "body": {
+                    "string": "{\n  \"kind\": \"drive#file\",\n  \"id\": \"1fEaDzl5YT3ZuLNfFxPapFUYU0kOfbXitSS9gBj7R-0I\",\n  \"name\": \"Test ClientTest test_client_export_spreadsheet\",\n  \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n"
+                }
+            }
+        },
+        {
+            "request": {
+                "method": "GET",
+                "uri": "https://sheets.googleapis.com/v4/spreadsheets/1fEaDzl5YT3ZuLNfFxPapFUYU0kOfbXitSS9gBj7R-0I?includeGridData=false",
+                "body": null,
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 200,
+                    "message": "OK"
+                },
+                "headers": {
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:29 GMT"
+                    ],
+                    "Content-Type": [
+                        "application/json; charset=UTF-8"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Vary": [
+                        "Origin",
+                        "X-Origin",
+                        "Referer"
+                    ],
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "x-l2-request-path": [
+                        "l2-managed-6"
+                    ],
+                    "Transfer-Encoding": [
+                        "chunked"
+                    ],
+                    "Cache-Control": [
+                        "private"
+                    ],
+                    "content-length": [
+                        "3344"
+                    ]
+                },
+                "body": {
+                    "string": "{\n  \"spreadsheetId\": \"1fEaDzl5YT3ZuLNfFxPapFUYU0kOfbXitSS9gBj7R-0I\",\n  \"properties\": {\n    \"title\": \"Test ClientTest test_client_export_spreadsheet\",\n    \"locale\": \"en_US\",\n    \"autoRecalc\": \"ON_CHANGE\",\n    \"timeZone\": \"Etc/GMT\",\n    \"defaultFormat\": {\n      \"backgroundColor\": {\n        \"red\": 1,\n        \"green\": 1,\n        \"blue\": 1\n      },\n      \"padding\": {\n        \"top\": 2,\n        \"right\": 3,\n        \"bottom\": 2,\n        \"left\": 3\n      },\n      \"verticalAlignment\": \"BOTTOM\",\n      \"wrapStrategy\": \"OVERFLOW_CELL\",\n      \"textFormat\": {\n        \"foregroundColor\": {},\n        \"fontFamily\": \"arial,sans,sans-serif\",\n        \"fontSize\": 10,\n        \"bold\": false,\n        \"italic\": false,\n        \"strikethrough\": false,\n        \"underline\": false,\n        \"foregroundColorStyle\": {\n          \"rgbColor\": {}\n        }\n      },\n      \"backgroundColorStyle\": {\n        \"rgbColor\": {\n          \"red\": 1,\n          \"green\": 1,\n          \"blue\": 1\n        }\n      }\n    },\n    \"spreadsheetTheme\": {\n      \"primaryFontFamily\": \"Arial\",\n      \"themeColors\": [\n        {\n          \"colorType\": \"TEXT\",\n          \"color\": {\n            \"rgbColor\": {}\n          }\n        },\n        {\n          \"colorType\": \"BACKGROUND\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 1,\n              \"green\": 1,\n              \"blue\": 1\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT1\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.25882354,\n              \"green\": 0.52156866,\n              \"blue\": 0.95686275\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT2\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.91764706,\n              \"green\": 0.2627451,\n              \"blue\": 0.20784314\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT3\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.9843137,\n              \"green\": 0.7372549,\n              \"blue\": 0.015686275\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT4\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.20392157,\n              \"green\": 0.65882355,\n              \"blue\": 0.3254902\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT5\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 1,\n              \"green\": 0.42745098,\n              \"blue\": 0.003921569\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT6\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.27450982,\n              \"green\": 0.7411765,\n              \"blue\": 0.7764706\n            }\n          }\n        },\n        {\n          \"colorType\": \"LINK\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.06666667,\n              \"green\": 0.33333334,\n              \"blue\": 0.8\n            }\n          }\n        }\n      ]\n    }\n  },\n  \"sheets\": [\n    {\n      \"properties\": {\n        \"sheetId\": 0,\n        \"title\": \"Sheet1\",\n        \"index\": 0,\n        \"sheetType\": \"GRID\",\n        \"gridProperties\": {\n          \"rowCount\": 1000,\n          \"columnCount\": 26\n        }\n      }\n    }\n  ],\n  \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1fEaDzl5YT3ZuLNfFxPapFUYU0kOfbXitSS9gBj7R-0I/edit\"\n}\n"
+                }
+            }
+        },
+        {
+            "request": {
+                "method": "GET",
+                "uri": "https://sheets.googleapis.com/v4/spreadsheets/1fEaDzl5YT3ZuLNfFxPapFUYU0kOfbXitSS9gBj7R-0I?includeGridData=false",
+                "body": null,
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 200,
+                    "message": "OK"
+                },
+                "headers": {
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:29 GMT"
+                    ],
+                    "Content-Type": [
+                        "application/json; charset=UTF-8"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Vary": [
+                        "Origin",
+                        "X-Origin",
+                        "Referer"
+                    ],
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "x-l2-request-path": [
+                        "l2-managed-6"
+                    ],
+                    "Transfer-Encoding": [
+                        "chunked"
+                    ],
+                    "Cache-Control": [
+                        "private"
+                    ],
+                    "content-length": [
+                        "3344"
+                    ]
+                },
+                "body": {
+                    "string": "{\n  \"spreadsheetId\": \"1fEaDzl5YT3ZuLNfFxPapFUYU0kOfbXitSS9gBj7R-0I\",\n  \"properties\": {\n    \"title\": \"Test ClientTest test_client_export_spreadsheet\",\n    \"locale\": \"en_US\",\n    \"autoRecalc\": \"ON_CHANGE\",\n    \"timeZone\": \"Etc/GMT\",\n    \"defaultFormat\": {\n      \"backgroundColor\": {\n        \"red\": 1,\n        \"green\": 1,\n        \"blue\": 1\n      },\n      \"padding\": {\n        \"top\": 2,\n        \"right\": 3,\n        \"bottom\": 2,\n        \"left\": 3\n      },\n      \"verticalAlignment\": \"BOTTOM\",\n      \"wrapStrategy\": \"OVERFLOW_CELL\",\n      \"textFormat\": {\n        \"foregroundColor\": {},\n        \"fontFamily\": \"arial,sans,sans-serif\",\n        \"fontSize\": 10,\n        \"bold\": false,\n        \"italic\": false,\n        \"strikethrough\": false,\n        \"underline\": false,\n        \"foregroundColorStyle\": {\n          \"rgbColor\": {}\n        }\n      },\n      \"backgroundColorStyle\": {\n        \"rgbColor\": {\n          \"red\": 1,\n          \"green\": 1,\n          \"blue\": 1\n        }\n      }\n    },\n    \"spreadsheetTheme\": {\n      \"primaryFontFamily\": \"Arial\",\n      \"themeColors\": [\n        {\n          \"colorType\": \"TEXT\",\n          \"color\": {\n            \"rgbColor\": {}\n          }\n        },\n        {\n          \"colorType\": \"BACKGROUND\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 1,\n              \"green\": 1,\n              \"blue\": 1\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT1\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.25882354,\n              \"green\": 0.52156866,\n              \"blue\": 0.95686275\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT2\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.91764706,\n              \"green\": 0.2627451,\n              \"blue\": 0.20784314\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT3\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.9843137,\n              \"green\": 0.7372549,\n              \"blue\": 0.015686275\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT4\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.20392157,\n              \"green\": 0.65882355,\n              \"blue\": 0.3254902\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT5\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 1,\n              \"green\": 0.42745098,\n              \"blue\": 0.003921569\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT6\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.27450982,\n              \"green\": 0.7411765,\n              \"blue\": 0.7764706\n            }\n          }\n        },\n        {\n          \"colorType\": \"LINK\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.06666667,\n              \"green\": 0.33333334,\n              \"blue\": 0.8\n            }\n          }\n        }\n      ]\n    }\n  },\n  \"sheets\": [\n    {\n      \"properties\": {\n        \"sheetId\": 0,\n        \"title\": \"Sheet1\",\n        \"index\": 0,\n        \"sheetType\": \"GRID\",\n        \"gridProperties\": {\n          \"rowCount\": 1000,\n          \"columnCount\": 26\n        }\n      }\n    }\n  ],\n  \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1fEaDzl5YT3ZuLNfFxPapFUYU0kOfbXitSS9gBj7R-0I/edit\"\n}\n"
+                }
+            }
+        },
+        {
+            "request": {
+                "method": "PUT",
+                "uri": "https://sheets.googleapis.com/v4/spreadsheets/1fEaDzl5YT3ZuLNfFxPapFUYU0kOfbXitSS9gBj7R-0I/values/%27Sheet1%27%21A1%3AB2?valueInputOption=RAW",
+                "body": "{\"values\": [[\"a1\", \"B2\"]], \"majorDimension\": null}",
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "Content-Length": [
+                        "50"
+                    ],
+                    "Content-Type": [
+                        "application/json"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 200,
+                    "message": "OK"
+                },
+                "headers": {
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:30 GMT"
+                    ],
+                    "Content-Type": [
+                        "application/json; charset=UTF-8"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Vary": [
+                        "Origin",
+                        "X-Origin",
+                        "Referer"
+                    ],
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "x-l2-request-path": [
+                        "l2-managed-6"
+                    ],
+                    "Transfer-Encoding": [
+                        "chunked"
+                    ],
+                    "Cache-Control": [
+                        "private"
+                    ],
+                    "content-length": [
+                        "168"
+                    ]
+                },
+                "body": {
+                    "string": "{\n  \"spreadsheetId\": \"1fEaDzl5YT3ZuLNfFxPapFUYU0kOfbXitSS9gBj7R-0I\",\n  \"updatedRange\": \"Sheet1!A1:B1\",\n  \"updatedRows\": 1,\n  \"updatedColumns\": 2,\n  \"updatedCells\": 2\n}\n"
+                }
+            }
+        },
+        {
+            "request": {
+                "method": "GET",
+                "uri": "https://www.googleapis.com/drive/v3/files/1fEaDzl5YT3ZuLNfFxPapFUYU0kOfbXitSS9gBj7R-0I/export?mimeType=text%2Fcsv",
+                "body": null,
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 200,
+                    "message": "OK"
+                },
+                "headers": {
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:30 GMT"
+                    ],
+                    "X-GUploader-UploadID": [
+                        "ABPtcPpyQMUSi1FArIhJ9Wli20pJx3k-JsRa7208kF72_kMznYxnpfGD3kpMvU8HRhMjMHBmKwMo3uQvEA"
+                    ],
+                    "Content-Type": [
+                        "text/csv"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "Expires": [
+                        "Tue, 30 Jan 2024 23:34:30 GMT"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Vary": [
+                        "Origin, X-Origin"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "Content-Length": [
+                        "5"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "Cache-Control": [
+                        "private, max-age=0, must-revalidate"
+                    ],
+                    "Content-Disposition": [
+                        "attachment"
+                    ],
+                    "Access-Control-Allow-Credentials": [
+                        "true"
+                    ]
+                },
+                "body": {
+                    "string": "a1,B2"
+                }
+            }
+        },
+        {
+            "request": {
+                "method": "DELETE",
+                "uri": "https://www.googleapis.com/drive/v3/files/1fEaDzl5YT3ZuLNfFxPapFUYU0kOfbXitSS9gBj7R-0I?supportsAllDrives=True",
+                "body": null,
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "Content-Length": [
+                        "0"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 204,
+                    "message": "No Content"
+                },
+                "headers": {
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:31 GMT"
+                    ],
+                    "Content-Type": [
+                        "text/html"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "Expires": [
+                        "Mon, 01 Jan 1990 00:00:00 GMT"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Vary": [
+                        "Origin, X-Origin"
+                    ],
+                    "Pragma": [
+                        "no-cache"
+                    ],
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "Cache-Control": [
+                        "no-cache, no-store, max-age=0, must-revalidate"
+                    ],
+                    "Content-Length": [
+                        "0"
+                    ]
+                },
+                "body": {
+                    "string": ""
+                }
+            }
+        }
+    ]
+}
diff --git a/tests/cassettes/SpreadsheetTest.test_export_spreadsheet.json b/tests/cassettes/SpreadsheetTest.test_export_spreadsheet.json
new file mode 100644
index 0000000..52ea62e
--- /dev/null
+++ b/tests/cassettes/SpreadsheetTest.test_export_spreadsheet.json
@@ -0,0 +1,461 @@
+{
+    "version": 1,
+    "interactions": [
+        {
+            "request": {
+                "method": "POST",
+                "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True",
+                "body": "{\"name\": \"Test SpreadsheetTest test_export_spreadsheet\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}",
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "Content-Length": [
+                        "111"
+                    ],
+                    "Content-Type": [
+                        "application/json"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 200,
+                    "message": "OK"
+                },
+                "headers": {
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "Cache-Control": [
+                        "no-cache, no-store, max-age=0, must-revalidate"
+                    ],
+                    "Vary": [
+                        "Origin, X-Origin"
+                    ],
+                    "Pragma": [
+                        "no-cache"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "Transfer-Encoding": [
+                        "chunked"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "Expires": [
+                        "Mon, 01 Jan 1990 00:00:00 GMT"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:40 GMT"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Content-Type": [
+                        "application/json; charset=UTF-8"
+                    ],
+                    "content-length": [
+                        "198"
+                    ]
+                },
+                "body": {
+                    "string": "{\n  \"kind\": \"drive#file\",\n  \"id\": \"1prFqy9DWoiXkdkNFfwzFVOZBtuCrc8yXNZrEYvOX1j8\",\n  \"name\": \"Test SpreadsheetTest test_export_spreadsheet\",\n  \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n"
+                }
+            }
+        },
+        {
+            "request": {
+                "method": "GET",
+                "uri": "https://sheets.googleapis.com/v4/spreadsheets/1prFqy9DWoiXkdkNFfwzFVOZBtuCrc8yXNZrEYvOX1j8?includeGridData=false",
+                "body": null,
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 200,
+                    "message": "OK"
+                },
+                "headers": {
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "Cache-Control": [
+                        "private"
+                    ],
+                    "Vary": [
+                        "Origin",
+                        "X-Origin",
+                        "Referer"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Transfer-Encoding": [
+                        "chunked"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "x-l2-request-path": [
+                        "l2-managed-6"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "Content-Type": [
+                        "application/json; charset=UTF-8"
+                    ],
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:41 GMT"
+                    ],
+                    "content-length": [
+                        "3342"
+                    ]
+                },
+                "body": {
+                    "string": "{\n  \"spreadsheetId\": \"1prFqy9DWoiXkdkNFfwzFVOZBtuCrc8yXNZrEYvOX1j8\",\n  \"properties\": {\n    \"title\": \"Test SpreadsheetTest test_export_spreadsheet\",\n    \"locale\": \"en_US\",\n    \"autoRecalc\": \"ON_CHANGE\",\n    \"timeZone\": \"Etc/GMT\",\n    \"defaultFormat\": {\n      \"backgroundColor\": {\n        \"red\": 1,\n        \"green\": 1,\n        \"blue\": 1\n      },\n      \"padding\": {\n        \"top\": 2,\n        \"right\": 3,\n        \"bottom\": 2,\n        \"left\": 3\n      },\n      \"verticalAlignment\": \"BOTTOM\",\n      \"wrapStrategy\": \"OVERFLOW_CELL\",\n      \"textFormat\": {\n        \"foregroundColor\": {},\n        \"fontFamily\": \"arial,sans,sans-serif\",\n        \"fontSize\": 10,\n        \"bold\": false,\n        \"italic\": false,\n        \"strikethrough\": false,\n        \"underline\": false,\n        \"foregroundColorStyle\": {\n          \"rgbColor\": {}\n        }\n      },\n      \"backgroundColorStyle\": {\n        \"rgbColor\": {\n          \"red\": 1,\n          \"green\": 1,\n          \"blue\": 1\n        }\n      }\n    },\n    \"spreadsheetTheme\": {\n      \"primaryFontFamily\": \"Arial\",\n      \"themeColors\": [\n        {\n          \"colorType\": \"TEXT\",\n          \"color\": {\n            \"rgbColor\": {}\n          }\n        },\n        {\n          \"colorType\": \"BACKGROUND\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 1,\n              \"green\": 1,\n              \"blue\": 1\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT1\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.25882354,\n              \"green\": 0.52156866,\n              \"blue\": 0.95686275\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT2\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.91764706,\n              \"green\": 0.2627451,\n              \"blue\": 0.20784314\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT3\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.9843137,\n              \"green\": 0.7372549,\n              \"blue\": 0.015686275\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT4\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.20392157,\n              \"green\": 0.65882355,\n              \"blue\": 0.3254902\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT5\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 1,\n              \"green\": 0.42745098,\n              \"blue\": 0.003921569\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT6\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.27450982,\n              \"green\": 0.7411765,\n              \"blue\": 0.7764706\n            }\n          }\n        },\n        {\n          \"colorType\": \"LINK\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.06666667,\n              \"green\": 0.33333334,\n              \"blue\": 0.8\n            }\n          }\n        }\n      ]\n    }\n  },\n  \"sheets\": [\n    {\n      \"properties\": {\n        \"sheetId\": 0,\n        \"title\": \"Sheet1\",\n        \"index\": 0,\n        \"sheetType\": \"GRID\",\n        \"gridProperties\": {\n          \"rowCount\": 1000,\n          \"columnCount\": 26\n        }\n      }\n    }\n  ],\n  \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1prFqy9DWoiXkdkNFfwzFVOZBtuCrc8yXNZrEYvOX1j8/edit\"\n}\n"
+                }
+            }
+        },
+        {
+            "request": {
+                "method": "GET",
+                "uri": "https://sheets.googleapis.com/v4/spreadsheets/1prFqy9DWoiXkdkNFfwzFVOZBtuCrc8yXNZrEYvOX1j8?includeGridData=false",
+                "body": null,
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 200,
+                    "message": "OK"
+                },
+                "headers": {
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "Cache-Control": [
+                        "private"
+                    ],
+                    "Vary": [
+                        "Origin",
+                        "X-Origin",
+                        "Referer"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Transfer-Encoding": [
+                        "chunked"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "x-l2-request-path": [
+                        "l2-managed-6"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "Content-Type": [
+                        "application/json; charset=UTF-8"
+                    ],
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:41 GMT"
+                    ],
+                    "content-length": [
+                        "3342"
+                    ]
+                },
+                "body": {
+                    "string": "{\n  \"spreadsheetId\": \"1prFqy9DWoiXkdkNFfwzFVOZBtuCrc8yXNZrEYvOX1j8\",\n  \"properties\": {\n    \"title\": \"Test SpreadsheetTest test_export_spreadsheet\",\n    \"locale\": \"en_US\",\n    \"autoRecalc\": \"ON_CHANGE\",\n    \"timeZone\": \"Etc/GMT\",\n    \"defaultFormat\": {\n      \"backgroundColor\": {\n        \"red\": 1,\n        \"green\": 1,\n        \"blue\": 1\n      },\n      \"padding\": {\n        \"top\": 2,\n        \"right\": 3,\n        \"bottom\": 2,\n        \"left\": 3\n      },\n      \"verticalAlignment\": \"BOTTOM\",\n      \"wrapStrategy\": \"OVERFLOW_CELL\",\n      \"textFormat\": {\n        \"foregroundColor\": {},\n        \"fontFamily\": \"arial,sans,sans-serif\",\n        \"fontSize\": 10,\n        \"bold\": false,\n        \"italic\": false,\n        \"strikethrough\": false,\n        \"underline\": false,\n        \"foregroundColorStyle\": {\n          \"rgbColor\": {}\n        }\n      },\n      \"backgroundColorStyle\": {\n        \"rgbColor\": {\n          \"red\": 1,\n          \"green\": 1,\n          \"blue\": 1\n        }\n      }\n    },\n    \"spreadsheetTheme\": {\n      \"primaryFontFamily\": \"Arial\",\n      \"themeColors\": [\n        {\n          \"colorType\": \"TEXT\",\n          \"color\": {\n            \"rgbColor\": {}\n          }\n        },\n        {\n          \"colorType\": \"BACKGROUND\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 1,\n              \"green\": 1,\n              \"blue\": 1\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT1\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.25882354,\n              \"green\": 0.52156866,\n              \"blue\": 0.95686275\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT2\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.91764706,\n              \"green\": 0.2627451,\n              \"blue\": 0.20784314\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT3\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.9843137,\n              \"green\": 0.7372549,\n              \"blue\": 0.015686275\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT4\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.20392157,\n              \"green\": 0.65882355,\n              \"blue\": 0.3254902\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT5\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 1,\n              \"green\": 0.42745098,\n              \"blue\": 0.003921569\n            }\n          }\n        },\n        {\n          \"colorType\": \"ACCENT6\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.27450982,\n              \"green\": 0.7411765,\n              \"blue\": 0.7764706\n            }\n          }\n        },\n        {\n          \"colorType\": \"LINK\",\n          \"color\": {\n            \"rgbColor\": {\n              \"red\": 0.06666667,\n              \"green\": 0.33333334,\n              \"blue\": 0.8\n            }\n          }\n        }\n      ]\n    }\n  },\n  \"sheets\": [\n    {\n      \"properties\": {\n        \"sheetId\": 0,\n        \"title\": \"Sheet1\",\n        \"index\": 0,\n        \"sheetType\": \"GRID\",\n        \"gridProperties\": {\n          \"rowCount\": 1000,\n          \"columnCount\": 26\n        }\n      }\n    }\n  ],\n  \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1prFqy9DWoiXkdkNFfwzFVOZBtuCrc8yXNZrEYvOX1j8/edit\"\n}\n"
+                }
+            }
+        },
+        {
+            "request": {
+                "method": "PUT",
+                "uri": "https://sheets.googleapis.com/v4/spreadsheets/1prFqy9DWoiXkdkNFfwzFVOZBtuCrc8yXNZrEYvOX1j8/values/%27Sheet1%27%21A1%3AB2?valueInputOption=RAW",
+                "body": "{\"values\": [[\"a1\", \"B2\"]], \"majorDimension\": null}",
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "Content-Length": [
+                        "50"
+                    ],
+                    "Content-Type": [
+                        "application/json"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 200,
+                    "message": "OK"
+                },
+                "headers": {
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "Cache-Control": [
+                        "private"
+                    ],
+                    "Vary": [
+                        "Origin",
+                        "X-Origin",
+                        "Referer"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Transfer-Encoding": [
+                        "chunked"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "x-l2-request-path": [
+                        "l2-managed-6"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "Content-Type": [
+                        "application/json; charset=UTF-8"
+                    ],
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:41 GMT"
+                    ],
+                    "content-length": [
+                        "168"
+                    ]
+                },
+                "body": {
+                    "string": "{\n  \"spreadsheetId\": \"1prFqy9DWoiXkdkNFfwzFVOZBtuCrc8yXNZrEYvOX1j8\",\n  \"updatedRange\": \"Sheet1!A1:B1\",\n  \"updatedRows\": 1,\n  \"updatedColumns\": 2,\n  \"updatedCells\": 2\n}\n"
+                }
+            }
+        },
+        {
+            "request": {
+                "method": "GET",
+                "uri": "https://www.googleapis.com/drive/v3/files/1prFqy9DWoiXkdkNFfwzFVOZBtuCrc8yXNZrEYvOX1j8/export?mimeType=text%2Fcsv",
+                "body": null,
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 200,
+                    "message": "OK"
+                },
+                "headers": {
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "X-GUploader-UploadID": [
+                        "ABPtcPpwN3m6BoHXvUu760qgpC4XkRuZw-tbLFB8MnBZ1Mnjy2ncYcTRbOVbisHbpw7vpA0mP9sIdCwnIg"
+                    ],
+                    "Cache-Control": [
+                        "private, max-age=0, must-revalidate"
+                    ],
+                    "Vary": [
+                        "Origin, X-Origin"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Content-Length": [
+                        "5"
+                    ],
+                    "Access-Control-Allow-Credentials": [
+                        "true"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "Expires": [
+                        "Tue, 30 Jan 2024 23:34:42 GMT"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "Content-Type": [
+                        "text/csv"
+                    ],
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:42 GMT"
+                    ],
+                    "Content-Disposition": [
+                        "attachment"
+                    ]
+                },
+                "body": {
+                    "string": "a1,B2"
+                }
+            }
+        },
+        {
+            "request": {
+                "method": "DELETE",
+                "uri": "https://www.googleapis.com/drive/v3/files/1prFqy9DWoiXkdkNFfwzFVOZBtuCrc8yXNZrEYvOX1j8?supportsAllDrives=True",
+                "body": null,
+                "headers": {
+                    "User-Agent": [
+                        "python-requests/2.31.0"
+                    ],
+                    "Accept-Encoding": [
+                        "gzip, deflate"
+                    ],
+                    "Accept": [
+                        "*/*"
+                    ],
+                    "Connection": [
+                        "keep-alive"
+                    ],
+                    "Content-Length": [
+                        "0"
+                    ],
+                    "authorization": [
+                        "<ACCESS_TOKEN>"
+                    ]
+                }
+            },
+            "response": {
+                "status": {
+                    "code": 204,
+                    "message": "No Content"
+                },
+                "headers": {
+                    "X-XSS-Protection": [
+                        "0"
+                    ],
+                    "Cache-Control": [
+                        "no-cache, no-store, max-age=0, must-revalidate"
+                    ],
+                    "Pragma": [
+                        "no-cache"
+                    ],
+                    "Vary": [
+                        "Origin, X-Origin"
+                    ],
+                    "X-Content-Type-Options": [
+                        "nosniff"
+                    ],
+                    "Content-Length": [
+                        "0"
+                    ],
+                    "Server": [
+                        "ESF"
+                    ],
+                    "Expires": [
+                        "Mon, 01 Jan 1990 00:00:00 GMT"
+                    ],
+                    "Alt-Svc": [
+                        "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
+                    ],
+                    "Date": [
+                        "Tue, 30 Jan 2024 23:34:42 GMT"
+                    ],
+                    "X-Frame-Options": [
+                        "SAMEORIGIN"
+                    ],
+                    "Content-Type": [
+                        "text/html"
+                    ]
+                },
+                "body": {
+                    "string": ""
+                }
+            }
+        }
+    ]
+}
diff --git a/tests/client_test.py b/tests/client_test.py
index ee7cc71..02b3fa6 100644
--- a/tests/client_test.py
+++ b/tests/client_test.py
@@ -135,3 +135,27 @@ class ClientTest(GspreadTest):
         private_id = "1jIKzPs8LsiZZdLdeMEP-5ZIHw6RkjiOmj1LrJN706Yc"
         with self.assertRaises(PermissionError):
             self.gc.open_by_key(private_id)
+
+    @pytest.mark.vcr()
+    def test_client_export_spreadsheet(self):
+        """Test the export feature of a spreadsheet.
+
+        JSON cannot serialize binary data (like PDF or OpenSpreadsheetFormat)
+        Export to CSV text format only
+        """
+
+        values = [
+            ["a1", "B2"],
+        ]
+        self.spreadsheet.sheet1.update(
+            values=values,
+            range_name="A1:B2",
+        )
+
+        res = self.gc.export(self.spreadsheet.id, gspread.utils.ExportFormat.CSV)
+
+        res_values = bytes(res).decode("utf-8").strip("'").split(",")
+
+        self.assertEqual(
+            values[0], res_values, "exported values are not the value initially set"
+        )
diff --git a/tests/spreadsheet_test.py b/tests/spreadsheet_test.py
index 9306c8d..be2fc15 100644
--- a/tests/spreadsheet_test.py
+++ b/tests/spreadsheet_test.py
@@ -212,3 +212,27 @@ class SpreadsheetTest(GspreadTest):
         """test lastUpdateTime property behaviour"""
         creationTime = self.spreadsheet.creationTime
         self.assertIsNotNone(creationTime)
+
+    @pytest.mark.vcr()
+    def test_export_spreadsheet(self):
+        """Test the export feature of a spreadsheet.
+
+        JSON cannot serialize binary data (like PDF or OpenSpreadsheetFormat)
+        Export to CSV text format only
+        """
+
+        values = [
+            ["a1", "B2"],
+        ]
+        self.spreadsheet.sheet1.update(
+            values=values,
+            range_name="A1:B2",
+        )
+
+        res = self.spreadsheet.export(gspread.utils.ExportFormat.CSV)
+
+        res_values = bytes(res).decode("utf-8").strip("'").split(",")
+
+        self.assertEqual(
+            values[0], res_values, "exported values are not the value initially set"
+        )