Answers for "%PDF-1.4 is response"

0

%PDF-1.4 is response

axios.post('http://www.example.com/generatePDF.php',
  {...params},
  {responseType: 'blob',  // VERY IMPORTANT
  headers: {'Accept': 'application/pdf'}})
.then((response) => {
  const blob = new Blob([response.data])
  const url = window.URL.createObjectURL(blob)
  this.setState({fileUrl: url, loading: false})
})
Posted by: Guest on July-16-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language