Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

%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})
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: get index of item with attribute javascript 
Javascript :: find if two elements in array sum to given integer js 
Javascript :: how to create date object with specific time in moment js 
Javascript :: cheat sheet javascript 
Javascript :: js remove all child elements from html 
Javascript :: javascript ajouter une donnée à une list 
Javascript :: using cors as middleware in js 
Javascript :: getelementsbytagname 
Javascript :: force delete and restore in sequelize 
Javascript :: jquery if is visible 
Javascript :: map keys to list node js 
Javascript :: upload image to server next js 
Javascript :: es6 spread 
Javascript :: js reverse number 
Javascript :: datepicker react native 
Javascript :: nuxt js route 
Javascript :: JavaScript BLOCK ENTER 
Javascript :: javascript get object where 
Javascript :: eval set global scope 
Javascript :: how to format datetime in javascript 
Javascript :: javascript json trypass 
Javascript :: js loop through form inputs 
Javascript :: how to run socket.io server 
Javascript :: mangoosejs 
Javascript :: push values to data object in vue 
Javascript :: react if statement 
Javascript :: how to set css in hbs 
Javascript :: javascript trigger keypress 
Javascript :: angular countdown begin stop pause 
Javascript :: multipart/form-data ajax jquery 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =