From 268793a89f01680b06feff0df28d1785c2bbce35 Mon Sep 17 00:00:00 2001 From: SanderH Date: Thu, 22 Apr 2021 10:46:26 +0100 Subject: [PATCH] Leave body as-is to support uploading binary files I was making my own Body using the ADODB.Recordset solution (see https://stackoverflow.com/questions/62165095/vba-send-file-in-binary-code-to-api-via-post-method), but this Property was being converted to rubbish. Excluding the ByteArray from getting converted makes it work without further alterations. --- src/WebRequest.cls | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/WebRequest.cls b/src/WebRequest.cls index 0196eb90..2ee00ac5 100644 --- a/src/WebRequest.cls +++ b/src/WebRequest.cls @@ -499,6 +499,8 @@ Public Property Get Body() As Variant If Not VBA.IsEmpty(web_pBody) Then If VBA.VarType(web_pBody) = vbString Then Body = web_pBody + ElseIf VBA.VarType(web_pBody) = vbArray Or vbByte Then + Body = web_pBody ElseIf IsEmpty(web_pConvertedBody) Then ' Convert body and cache Body = WebHelpers.ConvertToFormat(web_pBody, Me.RequestFormat, Me.CustomRequestFormat)