Repository: sunpy/sunpy

Issue:
JSOC Client errors with `Protocol("as-is")`
```python
query = (a.jsoc.Time("2014-12-18T18:00:00", "2014-12-18T18:00:00") & 
         a.jsoc.Series("hmi.m_720s") & a.jsoc.Notify(email) & a.jsoc.Protocol("as-is"))

res = Fido.search(query)
files = Fido.fetch(res)
```
```
Traceback (most recent call last):
  File "plot_jsoc_map_asis_sunpy", line 20, in <module>
    files = Fido.fetch(res)
  File "/home/stuart/Git/sunpy/sunpy/net/fido_factory.py", line 362, in fetch
    reslist.append(block.client.fetch(block, **kwargs))
  File "/home/stuart/Git/sunpy/sunpy/net/jsoc/jsoc.py", line 547, in fetch
    progress=progress, results=r)
  File "/home/stuart/Git/sunpy/sunpy/net/jsoc/jsoc.py", line 651, in get_request
    url_dir = request.request_url + '/'
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
```


Discussion:
The http query created would be: `http://jsoc.stanford.edu/cgi-bin/ajax/jsoc_fetch?op=exp_request&format=json&ds=hmi.m_720s%5B2014.12.18_18%3A00%3A35_TAI-2014.12.18_18%3A00%3A35_TAI%5D&notify=<email>&method=url_quick&protocol=as-is&filenamefmt=hmi.m_720s.%7BT_REC%3AA%7D.%7BCAMERA%7D.%7Bsegment%7D&requestor=jsoc`

The results clearly has `dir=''`. By definition of [`request_data`](https://github.com/sunpy/drms/blob/a9de2819d9e0aad715894cc4de889ba4b3a7fdad/drms/client.py#L341) the `request_data` is None if `self.dir` is None. Also, from the definition of [`dir`](https://github.com/sunpy/drms/blob/a9de2819d9e0aad715894cc4de889ba4b3a7fdad/drms/client.py#L295) it would be None.

Also I saw that protocol `as-is` has no `request_url` attribute, its request urls are stored in `urls.url` property. So I guess we have to update accordingly.
Let me know if this is the right approach.

Resolving patch:
diff --git a/sunpy/net/jsoc/jsoc.py b/sunpy/net/jsoc/jsoc.py
--- a/sunpy/net/jsoc/jsoc.py
+++ b/sunpy/net/jsoc/jsoc.py
@@ -4,6 +4,7 @@
 import urllib
 import warnings
 from collections.abc import Sequence
+from pathlib import Path
 
 import drms
 import numpy as np
@@ -560,7 +561,10 @@ def get_request(self, requests, path=None, overwrite=False, progress=True,
         if path is None:
             default_dir = config.get("downloads", "download_dir")
             path = os.path.join(default_dir, '{file}')
-        elif isinstance(path, str) and '{file}' not in path:
+        elif isinstance(path, Path):
+            path = str(path)
+
+        if isinstance(path, str) and '{file}' not in path:
             path = os.path.join(path, '{file}')
 
         paths = []
@@ -584,9 +588,13 @@ def get_request(self, requests, path=None, overwrite=False, progress=True,
         urls = []
         for request in requests:
             if request.status == 0:
-                for index, data in request.data.iterrows():
-                    url_dir = request.request_url + '/'
-                    urls.append(urllib.parse.urljoin(url_dir, data['filename']))
+                if request.protocol == 'as-is':
+                    urls.extend(list(request.urls.url))
+                else:
+                    for index, data in request.data.iterrows():
+                        url_dir = request.request_url + '/'
+                        urls.append(urllib.parse.urljoin(url_dir, data['filename']))
+
         if urls:
             if progress:
                 print_message = "{0} URLs found for download. Full request totalling {1}MB"


Test patch:
diff --git a/sunpy/net/jsoc/tests/test_jsoc.py b/sunpy/net/jsoc/tests/test_jsoc.py
--- a/sunpy/net/jsoc/tests/test_jsoc.py
+++ b/sunpy/net/jsoc/tests/test_jsoc.py
@@ -318,3 +318,17 @@ def test_results_filenames():
     assert len(files) == len(responses)
     for hmiurl in files:
         assert os.path.isfile(hmiurl)
+
+
+@pytest.mark.remote_data
+def test_results_filenames_as_is(tmp_path):
+    responses = client.search(
+        a.Time('2014/1/1T1:00:36', '2014/1/1T01:01:38'),
+        a.jsoc.Series('hmi.M_45s'), a.jsoc.Notify('jsoc@cadair.com'),
+        a.jsoc.Protocol('as-is'))
+    assert len(responses) == 2
+    files = client.fetch(responses, path=tmp_path)
+    assert isinstance(files, Results)
+    assert len(files) == len(responses)
+    for hmiurl in files:
+        assert os.path.isfile(hmiurl)