diff --git a/msrest/service_client.py b/msrest/service_client.py
index eed50c5..d86fcbb 100644
--- a/msrest/service_client.py
+++ b/msrest/service_client.py
@@ -164,10 +164,15 @@ class ServiceClient(object):
         """
         if content is None:
             content = {}
-        file_data = {f: self._format_data(d) for f, d in content.items()}
-        if headers:
-            headers.pop('Content-Type', None)
-        return self.send(request, headers, None, files=file_data, **config)
+        content_type = headers.pop('Content-Type', None) if headers else None
+
+        if content_type and content_type.lower() == 'application/x-www-form-urlencoded':
+            # Do NOT use "add_content" that assumes input is JSON
+            request.data = {f: d for f, d in content.items() if d is not None}
+            return self.send(request, headers, None, **config)
+        else: # Assume "multipart/form-data"
+            file_data = {f: self._format_data(d) for f, d in content.items() if d is not None}
+            return self.send(request, headers, None, files=file_data, **config)
 
     def send(self, request, headers=None, content=None, **config):
         """Prepare and send request object according to configuration.

Optional formData parameters crash msrest
If a parameter that is supposed to be formData is optional, we give `None` to requests:
```python
files = [('Text', (None, 'cognituve services')), ('Mode', (None, None)), ('PreContextText', (None, None)), ('PostContextText', (None, None))]
data = {}

    @staticmethod
    def _encode_files(files, data):
        """Build the body for a multipart/form-data request.

            Will successfully encode files when passed as a dict or a list of
            tuples. Order is retained if data is a list of tuples but arbitrary
            if parameters are supplied as a dict.
            The tuples may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype)
            or 4-tuples (filename, fileobj, contentype, custom_headers).
            """
        if (not files):
            raise ValueError("Files must be provided.")
        elif isinstance(data, basestring):
            raise ValueError("Data must not be a string.")

        new_fields = []
        fields = to_key_val_list(data or {})
        files = to_key_val_list(files or {})

        for field, val in fields:
            if isinstance(val, basestring) or not hasattr(val, '__iter__'):
                val = [val]
            for v in val:
                if v is not None:
                    # Don't call str() on bytestrings: in Py3 it all goes wrong.
                    if not isinstance(v, bytes):
                        v = str(v)

                    new_fields.append(
                        (field.decode('utf-8') if isinstance(field, bytes) else field,
                         v.encode('utf-8') if isinstance(v, str) else v))

        for (k, v) in files:
            # support for explicit filename
            ft = None
            fh = None
            if isinstance(v, (tuple, list)):
                if len(v) == 2:
                    fn, fp = v
                elif len(v) == 3:
                    fn, fp, ft = v
                else:
                    fn, fp, ft, fh = v
            else:
                fn = guess_filename(v) or k
                fp = v

            if isinstance(fp, (str, bytes, bytearray)):
                fdata = fp
            else:
>               fdata = fp.read()
E               AttributeError: 'NoneType' object has no attribute 'read'
```
diff --git a/tests/test_client.py b/tests/test_client.py
index ee10d48..650eac5 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -204,6 +204,17 @@ class TestServiceClient(unittest.TestCase):
         ServiceClient.send_formdata(mock_client, request, {'Content-Type':'1234'}, {'1':'1', '2':'2'})
         mock_client.send.assert_called_with(request, {}, None, files={'1':'formatted', '2':'formatted'})
 
+        ServiceClient.send_formdata(mock_client, request, {'Content-Type':'1234'}, {'1':'1', '2':None})
+        mock_client.send.assert_called_with(request, {}, None, files={'1':'formatted'})
+
+        ServiceClient.send_formdata(mock_client, request, {'Content-Type':'application/x-www-form-urlencoded'}, {'1':'1', '2':'2'})
+        mock_client.send.assert_called_with(request, {}, None)
+        self.assertEqual(request.data, {'1':'1', '2':'2'})
+
+        ServiceClient.send_formdata(mock_client, request, {'Content-Type':'application/x-www-form-urlencoded'}, {'1':'1', '2':None})
+        mock_client.send.assert_called_with(request, {}, None)
+        self.assertEqual(request.data, {'1':'1'})
+
     def test_format_data(self):
 
         mock_client = mock.create_autospec(ServiceClient)

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest numpy>=1.16.0 pandas>=1.0.0
apt-get update apt-get install -y gcc
3.9
requirements/base.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi==2025.1.31
charset-normalizer==3.4.1
exceptiongroup==1.2.2
idna==3.10
iniconfig==2.1.0
isodate==0.7.2
-e git+https://github.com/Azure/msrest-for-python.git@24deba7a7a9e335314058ec2d0b39a710f61be60#egg=msrest
numpy==2.0.2
oauthlib==3.2.2
packaging==24.2
pandas==2.2.3
pluggy==1.5.0
pytest==8.3.5
python-dateutil==2.9.0.post0
pytz==2025.2
requests==2.32.3
requests-oauthlib==2.0.0
six==1.17.0
tomli==2.2.1
tzdata==2025.2
urllib3==2.3.0

name: msrest-for-python
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - exceptiongroup==1.2.2
      - idna==3.10
      - iniconfig==2.1.0
      - isodate==0.7.2
      - numpy==2.0.2
      - oauthlib==3.2.2
      - packaging==24.2
      - pandas==2.2.3
      - pluggy==1.5.0
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - requests==2.32.3
      - requests-oauthlib==2.0.0
      - six==1.17.0
      - tomli==2.2.1
      - tzdata==2025.2
      - urllib3==2.3.0
prefix: /opt/conda/envs/msrest-for-python

tests/test_client.py::TestServiceClient::test_client_formdata_send
tests/test_client.py::TestServiceClient::test_client_header tests/test_client.py::TestServiceClient::test_client_request tests/test_client.py::TestServiceClient::test_client_send tests/test_client.py::TestServiceClient::test_format_data tests/test_client.py::TestServiceClient::test_format_url tests/test_client.py::TestServiceClient::test_session_callback
msrest/service_client.py
msrest/service_client.py