Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/WebClient.cls
Original file line number Diff line number Diff line change
Expand Up @@ -659,20 +659,29 @@ Public Function PrepareCurlRequest(Request As WebRequest) As String
If web_CookieString <> "" Then
web_Curl = web_Curl & " --cookie '" & web_CookieString & "'"
End If

' Add method, data, and url
' Add method
web_Curl = web_Curl & " -X " & WebHelpers.MethodToName(Request.Method)
web_Curl = web_Curl & " -d '" & Request.Body & "'"

' Add data
Open "requestbody.txt" For Output As #1
Print #1, Request.Body
Close #1
web_Curl = web_Curl & " -d @requestbody.txt'" & "'"

' Add url
web_Curl = web_Curl & " '" & Me.GetFullUrl(Request) & "'"

' Give authenticator opportunity to update cURL
If Not Me.Authenticator Is Nothing Then
Me.Authenticator.PrepareCurl Me, Request, web_Curl
End If

' Log request and return
' Log request
WebHelpers.LogRequest Me, Request
PrepareCurlRequest = web_Curl

' Remove data file and return
PrepareCurlRequest = web_Curl & "&& rm requestbody.txt"
Exit Function

web_ErrorHandling:
Expand Down