Skip to content

Commit

Permalink
update "Copy All" behavior to use the Heading 2 style instead of the …
Browse files Browse the repository at this point in the history
…Heading 1 style for text to copy
  • Loading branch information
sunny-chung committed Jan 10, 2025
1 parent 8222d39 commit 1b248a8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
30 changes: 15 additions & 15 deletions doc/features/viewing-responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The copied text is in a markdown-like format for readability.
Sample of copied text of a simple HTTP call:
``````markdown
Request
=======
-------
Start Time: 2024-02-18 23:33:31.426 (+08:00)

HTTP/2.0
Expand All @@ -88,7 +88,7 @@ Body:
`````

Response
========
--------
Completion Time: 2024-02-18 23:33:32.545 (+08:00)

Duration: 1.119s
Expand Down Expand Up @@ -137,7 +137,7 @@ Body:
Sample of copied text of a GraphQL subscription call:
``````markdown
Request
=======
-------
Start Time: 2024-02-18 23:35:03.259 (+08:00)

HTTP/1.1
Expand All @@ -155,7 +155,7 @@ User-Agent: Hello-HTTP/1.5.0-SNAPSHOT
`````

Response
========
--------
Status Code: 101 Switching Protocols

Headers:
Expand All @@ -166,7 +166,7 @@ upgrade: websocket
`````

Incoming #1
===========
-----------
Time: 2024-02-18 23:35:03.428 (+08:00)

Body:
Expand All @@ -176,7 +176,7 @@ Body:


Incoming #2
===========
-----------
Time: 2024-02-18 23:35:04.431 (+08:00)

Body:
Expand All @@ -186,7 +186,7 @@ Body:


Incoming #3
===========
-----------
Time: 2024-02-18 23:35:05.437 (+08:00)

Body:
Expand All @@ -196,7 +196,7 @@ Body:


Incoming #4
===========
-----------
Time: 2024-02-18 23:35:06.439 (+08:00)

Body:
Expand All @@ -206,7 +206,7 @@ Body:


End
===
---
Completion Time: 2024-02-18 23:35:06.441 (+08:00)

Duration: 3.182s
Expand All @@ -218,7 +218,7 @@ Closed by us with code 1000
Sample of copied text of a gRPC bidirectional call:
``````markdown
Request
=======
-------
Start Time: 2024-02-18 23:49:43.670 (+08:00)

HTTP/2.0
Expand All @@ -238,7 +238,7 @@ grpc-accept-encoding: gzip
`````

Outgoing #1
===========
-----------
Time: 2024-02-18 23:49:44.882 (+08:00)

Body:
Expand All @@ -250,7 +250,7 @@ Body:


Incoming #1
===========
-----------
Time: 2024-02-18 23:49:44.884 (+08:00)

Body:
Expand All @@ -262,7 +262,7 @@ Body:


Outgoing #2
===========
-----------
Time: 2024-02-18 23:49:46.415 (+08:00)

Body:
Expand All @@ -274,7 +274,7 @@ Body:


Incoming #2
===========
-----------
Time: 2024-02-18 23:49:46.417 (+08:00)

Body:
Expand All @@ -286,7 +286,7 @@ Body:


End
===
---
Completion Time: 2024-02-18 23:49:47.105 (+08:00)

Duration: 3.435s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ fun UserResponse.describeApplicationLayer() =
when {
payloadExchanges == null -> """
Request
=======
-------
Start Time: ${startAt?.atZoneOffset(KZoneOffset.local())?.format(TIME_FORMAT) ?: "-"}
${protocol?.toString().orEmpty()}
Expand Down Expand Up @@ -225,7 +225,7 @@ $BODY_BLOCK_DELIMITER${
""" } else ""
}Response
========
--------
${
if (endAt != null) {
"""Completion Time: ${endAt?.atZoneOffset(KZoneOffset.local())?.format(TIME_FORMAT) ?: "-"}
Expand Down Expand Up @@ -255,7 +255,7 @@ $BODY_BLOCK_DELIMITER
payloadExchanges != null -> buildString {
append("""
Request
=======
-------
Start Time: ${startAt?.atZoneOffset(KZoneOffset.local())?.format(TIME_FORMAT) ?: "-"}
${protocol?.toString().orEmpty()}
Expand All @@ -278,7 +278,7 @@ $BODY_BLOCK_DELIMITER
append("\n\n")
append("""
Response
========
--------
Status Code: ${statusCode ?: "-"}${statusText?.let { " $it" } ?: ""}
Headers:
Expand All @@ -298,7 +298,7 @@ $BODY_BLOCK_DELIMITER
"Outgoing #${++outgoingCount}"
}
append("\n\n", title, "\n")
append("=".repeat(title.length), "\n")
append("-".repeat(title.length), "\n")
append("Time: ${it.instant.atZoneOffset(KZoneOffset.local()).format(TIME_FORMAT)}\n\n")
append("Body:\n$BODY_BLOCK_DELIMITER\n")
append(it.data?.decodeToString()?.endWithNewLine().orEmpty())
Expand All @@ -309,7 +309,7 @@ $BODY_BLOCK_DELIMITER
if (endAt != null) {
append("\n\n", """
End
===
---
Completion Time: ${endAt?.atZoneOffset(KZoneOffset.local())?.format(TIME_FORMAT) ?: "-"}
Duration: ${String.format("%.3f", (endAt!! - startAt!!).millis / 1000.0)}s
Expand Down

0 comments on commit 1b248a8

Please sign in to comment.