Created
March 28, 2019 15:36
-
-
Save blueturtle13g/3c32df4ec69113a88518026f4c78964f to your computer and use it in GitHub Desktop.
RdXPpL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sorry I had a lot of trouble to log in my account in jsfiddle so chose codepen. | |
const URL = 'https://api.pdflayer.com/api/convert?access_key=63d65d2fdb1bfa11c676e37f275fe22e'; | |
axios.post(URL, { | |
document_html: `<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
hello world | |
</body> | |
</html>`, | |
test: "1" | |
}) | |
.then(function (response) { | |
console.log("response: ", response); | |
// please open your dev tools and you can see the error | |
// Note: in order to pass 'Access-Control-Allow-Origin' error, I installed this chrome extension: "https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi/related?hl=en-US" | |
}) | |
.catch(function (error) { | |
console.log("err: ", error); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment