Skip to content

Commit

Permalink
Print response status code
Browse files Browse the repository at this point in the history
  • Loading branch information
3lvis committed Oct 8, 2015
1 parent e1291f2 commit f6b5dde
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Source/Networking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,8 @@ public class Networking {
print("Error \(error.code): \(error.description)")
print(" ")

if let response = response {
print("Path: \(response.URL!.absoluteString)")
print(" ")
print("Response: \(response)")
if let request = request {
print("Request: \(request)")
print(" ")
}

Expand All @@ -187,8 +185,12 @@ public class Networking {
print(" ")
}

if let request = request {
print("Request: \(request)")
if let response = response as? NSHTTPURLResponse {
print("Response status code: \(response.statusCode)")
print(" ")
print("Path: \(response.URL!.absoluteString)")
print(" ")
print("Response: \(response)")
print(" ")
}

Expand Down

0 comments on commit f6b5dde

Please sign in to comment.