sst / sst.dev

Repo for sst.dev
https://sst.dev
MIT License
3.68k stars 445 forks source link

fix: use correct curl command for creating notes #727

Closed Mingyang-Li closed 11 months ago

Mingyang-Li commented 11 months ago

Issue

The original request body of the example has parsing issues once executed, I've updated it with the payload that worked for me.

Details

❌ Console outputs when using --body "{\"content\":\"hello world\",\"attachment\":\"hello.jpg\"}"

Getting temporary credentials
Making API request
undefined:1
{\
 ^

    at JSON.parse (<anonymous>)
    at makeRequest (C:\Users\admin\AppData\Local\npm-cache\_npx\ea84c6478cf14779\node_modules\aws-api-gateway-cli-test\index.js:179:17)

etc etc

✅ Console outputs when using --body '{""content\":\"hello world\",\"attachment\":\"hello.jpg\"}'

Authenticating with User Pool
Getting temporary credentials
Making API request
{
  status: 200,
  statusText: 'OK',
  data: {
    userId: 'PLACEHOLDER',
    noteId: 'PLACEHOLDER',
    content: 'hello world',
    attachment: 'hello.jpg',
    createdAt: PLACEHOLDER
  }
}
jayair commented 11 months ago

Which OS are you using?

Mingyang-Li commented 11 months ago

Which OS are you using?

Good question. I forgot to mention it in the PR - I'm using Windows

jayair commented 11 months ago

Thanks!