-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
54 lines (49 loc) · 1.15 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//Dependencies
const axios = require("axios").default //The HTTP request client
//Info
const token = require("./token.json")
//Create a client instance
const market = axios.create({
baseURL: "https://api.warframe.market/v1",
timeout: 1000,
headers: {
"content-type": "application/json",
"accept": "application/json",
"platform": "pc",
"language": "en",
}
})
const nkn1396 = axios.create({
baseURL: "https://api.warframe.market/v1",
timeout: 1000,
headers: {
"content-type": "application/json",
"accept": "application/json",
"platform": "pc",
"language": "en",
"authorization": `JWT ${token}`,
}
})
/*
//Anonymous request
market.get("/items")
.then(response => {
const fs = require("fs")
fs.writeFile("./items.json", JSON.stringify(response.data), {}, ()=>{})
console.log(response.data)
})
.catch(console.error)
//*/
//Authorized request
//The following puts one Latron Prime Receiver on warframe.market
nkn1396.post("/profile/orders", {
"order_type": "sell",
"item_id": "54a73e65e779893a797fff4b",
"platinum": 1337,
"quantity": 1,
})
.then(response => {
console.log(response)
console.log("SUCCESS!")
})
.catch(console.error)