(props: ResponseViewerProps)
| 154 | } |
| 155 | |
| 156 | export function ResponseViewerInfo(props: ResponseViewerProps) { |
| 157 | const { response } = props |
| 158 | |
| 159 | let rawContentType = undefined |
| 160 | if (response) { |
| 161 | rawContentType = getHeader(response.headers, 'content-type') |
| 162 | } |
| 163 | |
| 164 | return ( |
| 165 | <> |
| 166 | <Box mb="4"> |
| 167 | <Text as="h2" fontWeight={'bold'} mb="1"> |
| 168 | Status code |
| 169 | </Text> |
| 170 | <StatusCodeInfo statusCode={response?.statusCode} /> |
| 171 | </Box> |
| 172 | |
| 173 | <Box mb="4"> |
| 174 | <Headers headers={response?.headers || {}} /> |
| 175 | </Box> |
| 176 | |
| 177 | <BodyInfo body={response?.body} rawContentType={rawContentType} /> |
| 178 | </> |
| 179 | ) |
| 180 | } |
| 181 | |
| 182 | export interface ResponseViewerProps { |
| 183 | response: HTTPResponse |
nothing calls this directly
no test coverage detected