Skip to content

Commit

Permalink
Add a toString method to HttpResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Jul 11, 2019
1 parent c0b9b28 commit 8add72a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.openqa.selenium.remote.http;

import static java.net.HttpURLConnection.HTTP_OK;
import static org.openqa.selenium.remote.http.Contents.string;

public class HttpResponse extends HttpMessage<HttpResponse> {

Expand Down Expand Up @@ -52,4 +53,9 @@ public HttpResponse setTargetHost(String host) {
public String getTargetHost() {
return (String) getAttribute(HTTP_TARGET_HOST);
}

@Override
public String toString() {
return String.format("%s: %s", getStatus(), string(this));
}
}

0 comments on commit 8add72a

Please sign in to comment.