I started seeing issues with my function not working and I think I’ve narrowed down the issue to how my function is receiving my request once I POST to it.
When running this locally, there doesn’t seem to be any problems with my payload, it fires and returns a 200. However, when POSTing the exact same code to the deploy function, the body appears to be empty. I confirmed this with logs to debug the function.
To debug that, I console.log’ed the event itself, and it turns out on Netlify, my function is receiving that POST as a GET:
INFO event {
path: '/.netlify/functions/tweet',
httpMethod: 'GET',
headers: {
Locally:
Request from ::ffff:127.0.0.1: POST /tweet
Any thoughts about what’s going on here? I was originally running the function on node v8, but I updated the .nvmrc to v12 and tested locally with the same version (in both instances). Still the same issue.
Hi @colbyfayock, I tried invoking your function using insomnia and if you check your function logs, it does show the httpMethod as POST. Could you try using the object method like below?
I did however try to POST with fetch just to test and it seems to go through as a POST but just having trouble getting the formatting to take in the payload right so maybe it’s an issue between axios and the serverless framework which i’m using for the app?
The strange thing is that it works on my locally served netlify function (localhost:9000) but not when posting directly there.
6:27:34 AM: 896f1fbc ERROR Invoke Error {“errorType”:“Error”,“errorMessage”:“Problem with the SSL CA cert (path? access rights?)”,“code”:77,“isCurlError”:true,“stack”:[“Error: Problem with the SSL CA cert (path? access rights?)”]}
Sorry to hear you are having this issue. I see that you also commented in this thread as well. Let’s keep your responses on the other thread to streamline conversation and support. I assure you we haven’t forgotten about it yet!