I registered my account with Pastebin and tried to use the API, but
Bad API request, invalid api_dev_key
shows no sign of success.
The API key does not contain spaces, and I copied them from the page, so there is no mistake.
import*asqs from 'querystring'
import* as fetch from 'node-fetch'
~~~
constquery=qs.stringify({
api_option: 'paste',
api_dev_key: 'Copy API Key',
api_paste_name: `Tai-tori',
api_paste_format: 'javascript',
api_paste_code: 'Code',
})
const url = wait(
wait fetch.default(`https://pastebin.com/api/api_post.php?${query}`, {
method: 'POST',
})
) .text( )
console.log(url)
https://pastebin.com/xxxxxx
Bad API request, invalid api_dev_key
method:POST
, but the format appears to be HTTP GET
. For POST
, the body
parameter should be ${query}
.`
Thank you metropolis.
That's right. It was solved by passing it to body
.
© 2024 OneMinuteCode. All rights reserved.