diff --git a/src/core/components/highlight-code.jsx b/src/core/components/highlight-code.jsx
index bbdda2d0d35..c0feb7f9f8f 100644
--- a/src/core/components/highlight-code.jsx
+++ b/src/core/components/highlight-code.jsx
@@ -7,7 +7,8 @@ export default class HighlightCode extends Component {
static propTypes = {
value: PropTypes.string.isRequired,
className: PropTypes.string,
- downloadable: PropTypes.bool
+ downloadable: PropTypes.bool,
+ fileName: PropTypes.string
}
componentDidMount() {
@@ -23,7 +24,7 @@ export default class HighlightCode extends Component {
}
downloadText = () => {
- saveAs(this.props.value, "response.txt")
+ saveAs(this.props.value, this.props.fileName || "response.txt")
}
preventYScrollingBeyondElement = (e) => {
diff --git a/src/core/components/response-body.jsx b/src/core/components/response-body.jsx
index fd5eaa94281..cce5773feaa 100644
--- a/src/core/components/response-body.jsx
+++ b/src/core/components/response-body.jsx
@@ -52,6 +52,7 @@ export default class ResponseBody extends React.PureComponent {
let { content, contentType, url, headers={}, getComponent } = this.props
const { parsedContent } = this.state
const HighlightCode = getComponent("highlightCode")
+ const downloadName = "response_" + new Date().getTime()
let body, bodyEl
url = url || ""
@@ -100,7 +101,7 @@ export default class ResponseBody extends React.PureComponent {
body = "can't parse JSON. Raw result:\n\n" + content
}
- bodyEl =
Unrecognized response type; displaying content as text.
-