Skip to content

Commit

Permalink
Update convertURLRequestToCurlCommand(_:)
Browse files Browse the repository at this point in the history
Ensure that `convertURLRequestToCurlCommand(_:)` prints the httpBody for PUT requests.
  • Loading branch information
danielt1263 authored and freak4pc committed Sep 13, 2019
1 parent 19d3cdb commit f6115f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RxCocoa/Foundation/URLSession+Rx.swift
Expand Up @@ -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))\" "
Expand Down

0 comments on commit f6115f5

Please sign in to comment.