RESTMessageV2 does not encode file names correctly over MIDDescriptionWhen using the RESTMessageV2 API function saveResponseBodyAsAttachment() with a MID server, the filename (3rd parameter) will not be properly encoded if it contains spaces.Steps to Reproduce 1- Create a RESTMessageV2 that tries to save the response to a record over MID. 2- Execute it in a background script. 3- Open the MID logs and search for something similar to the following stack trace:Worker-Expedited:MIDWorker-80ed8524c7af101060339b6bb4c26031 SEVERE *** ERROR *** java.lang.IllegalArgumentException: Invalid uri 'http://localhost:8080/api/now/v1/attachment/file?file_name=Granting-BL-access to-Oracle_Deploy_Linux-role2.html&table_name=incident&table_sys_id=a83820b58f723300e7e16c7827bdeed2': Invalid queryat org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:222)at org.apache.commons.httpclient.methods.ExpectContinueMethod.<init>(ExpectContinueMethod.java:93)at org.apache.commons.httpclient.methods.EntityEnclosingMethod.<init>(EntityEnclosingMethod.java:119)at org.apache.commons.httpclient.methods.PostMethod.<init>(PostMethod.java:106)at com.glide.communications.HTTPRequest.post(HTTPRequest.java:240)at com.snc.commons.AttachmentHttpRequest.uploadAttachment(AttachmentHttpRequest.java:53)at com.snc.commons.eccprobe.RESTProbe.saveResponseStreamAsAttachment(RESTProbe.java:274)at com.snc.commons.eccprobe.RESTProbe.handleHttpResponse(RESTProbe.java:244)at com.snc.commons.eccprobe.RESTProbe.probe(RESTProbe.java:186)at com.service_now.mid.probe.ECCProbeProxy.probe(ECCProbeProxy.java:57)at com.service_now.mid.probe.AProbe.process(AProbe.java:104)at com.snc.commons.eccprobe.AECCProbe.process(AECCProbe.java:82)at com.service_now.mid.queue_worker.MIDWorker.process(MIDWorker.java:27)at com.service_now.mid.queue_worker.AWorker.runWorker(AWorker.java:122)at com.service_now.mid.queue_worker.AWorkerThread.run(AWorkerThread.java:20)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)at java.lang.Thread.run(Thread.java:748)WorkaroundAfter carefully considering the severity and frequency of the issue, and the cost and risk of attempting a fix, it has been decided to not address this issue in any current or near future releases. We do not make this decision lightly, and we apologise for any inconvenience. Using a REST Step, i.e. with save as attachment having the file name containing spaces, saves the file name correctly. The workaround for the function is to remove spaces from attachment filenames, or to use %20 instead of a space. For example, this will fail:request.saveResponseBodyAsAttachment('incident','fde351a01b2b9c543222ea89bd4bcb5', 'Some file name with spaces in it.doc'); This will work:request.saveResponseBodyAsAttachment('incident','fde351a01b2b9c543222ea89bd4bcb5', 'Some%20file%20name%20with%20spaces%20in%20it.doc');Related Problem: PRB1432364