From f6115f57d77fa628a7281f140bb14eb8e148c07d Mon Sep 17 00:00:00 2001 From: Daniel Tartaglia Date: Thu, 12 Sep 2019 16:17:45 -0400 Subject: [PATCH] Update `convertURLRequestToCurlCommand(_:)` Ensure that `convertURLRequestToCurlCommand(_:)` prints the httpBody for PUT requests. --- RxCocoa/Foundation/URLSession+Rx.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RxCocoa/Foundation/URLSession+Rx.swift b/RxCocoa/Foundation/URLSession+Rx.swift index f074c3382..da63a0ca3 100644 --- a/RxCocoa/Foundation/URLSession+Rx.swift +++ b/RxCocoa/Foundation/URLSession+Rx.swift @@ -64,7 +64,7 @@ private func convertURLRequestToCurlCommand(_ request: URLRequest) -> String { let method = request.httpMethod ?? "GET" var returnValue = "curl -X \(method) " - if let httpBody = request.httpBody, request.httpMethod == "POST" { + if let httpBody = request.httpBody, request.httpMethod == "POST" || request.httpMethod == "PUT" { let maybeBody = String(data: httpBody, encoding: String.Encoding.utf8) if let body = maybeBody { returnValue += "-d \"\(escapeTerminalString(body))\" "