Was it just about the content-type?!
This commit is contained in:
@@ -19,15 +19,14 @@ export const POST = (async ({ request, fetch }) => {
|
||||
// Newsletter API request
|
||||
const req = await fetch(`https://emailoctopus.com/api/1.6/lists/${NEWSLETTER_LIST_ID}/contacts`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
headers: { 'content-type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
api_key: NEWSLETTER_API_TOKEN,
|
||||
email_address: email,
|
||||
})
|
||||
})
|
||||
const res = await req.text()
|
||||
const res = await req.json()
|
||||
console.log('server:', res)
|
||||
return new Response(res)
|
||||
|
||||
// Other error
|
||||
if (res && res.status !== 'PENDING') {
|
||||
|
||||
Reference in New Issue
Block a user