Created
April 18, 2017 09:33
-
-
Save kn9ts/0f6c8d0adf87d31ab64622e60f7941e9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const request = new XMLHttpRequest(); | |
request.open('POST', 'https://vitumob.xyz/order', true); | |
request.setRequestHeader('Accept', 'application/json, */*'); | |
request.setRequestHeader('Content-Type', 'application/json;charset=utf-8'); | |
request.onload = () => { | |
if (request.readyState === request.DONE && request.status === 200) { | |
component.order = JSON.parse(request.responseText); | |
console.log('order: http://vitumob.xyz/cart/' + component.order.order_hex); | |
} | |
}; | |
request.onerror = (error) => { console.error(error); }; | |
const orderToString = JSON.stringify({ order: JSON.stringify(order) }); | |
request.send(orderToString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment