(f: flow.Flow)
| 101 | |
| 102 | |
| 103 | def httpie_command(f: flow.Flow) -> str: |
| 104 | request = cleanup_request(f) |
| 105 | pop_headers(request) |
| 106 | |
| 107 | # TODO: Once https://github.com/httpie/httpie/issues/414 is implemented, we |
| 108 | # should ensure we always connect to the IP address specified in the flow, |
| 109 | # similar to how it's done in curl_command. |
| 110 | url = request.pretty_url |
| 111 | |
| 112 | args = ["http", request.method, url] |
| 113 | for k, v in request.headers.items(multi=True): |
| 114 | args.append(f"{k}: {v}") |
| 115 | cmd = " ".join(shlex.quote(arg) for arg in args) |
| 116 | if request.content: |
| 117 | cmd += " <<< " + request_content_for_console(request) |
| 118 | return cmd |
| 119 | |
| 120 | |
| 121 | def raw_request(f: flow.Flow) -> bytes: |
nothing calls this directly
no test coverage detected
searching dependent graphs…