I don’t quite remember why I don’t have the filepath key set there, but I assume it could have been because the path was remote, I did not add it. Or because this value is optional.
It could be that either your remote file or the one I tested with, has some issue… in anycase, having the extra param does not hurt, so will add it to the repo.
Glad to see you got it work finally, and probably learned enough to create your own extensions.
This doesn’t happen in your extension. I’m guessing it’s due to wappler limitations, but I haven’t worked with extensions enough to know for sure. Do you know if it’s possible to get this in the UI?
What’s your version of node-fetch and form-data? I got this error on latest versions:
require() of ES Module /opt/node_app/node_modules/node-fetch/src/index.js from /opt/node_app/extensions/server_connect/modules/FileUploadModule.js not supported.\nInstead change the require of index.js in /opt/node_app/extensions/server_connect/modules/FileUploadModule.js to a dynamic import() which is available in all CommonJS modules.
Edit: Fixed by downgrading node-fetch:
npm install node-fetch@2 --save
There’s also a bug with node-fetch, the multipart/form-data boundary is not sent in the headers, so this can cause some requests to fail with a 500 Internal Server Error or similar.
Patch, intentionally delete the Content-Type header so it can be filled automatically:
I’m running the server action where I put this extension in, in the browser.
The extension returns this: "
and this in the devtools
I’m getting ‘retry later’ because I’m rate limited.
I think they probably give me more information (so I know where to continue off) but not sure if I’m missing it because they don’t send it… OR that the extension doesn’t pass this back.
I’m guessing the latter.
How can I edit the extension so it passes all the info it gets from the endpoint?
You can’t edit the extension if you don’t know how exactly they’re returning the additional information
However, such information is usually passed by response headers, so in your response you want to include (copy) some of the response headers from the request
You may only want to copy the response headers that are not already present in your response object, so you don’t overwrite important ones, e.g.: “Host”
If you look at the code towards the end, you will see that the extension is returning the complete response object as is - success or failure. Which is probably why you are seeing the correct status code of 429.
Best to run the API on Postman to see the returned response.
Having dealt with 429s before, I think “Retry later” is the only response body that you are getting, along with 429 status code. Or there could be something in the headers as Apple suggests.
This was requested sometime ago as well. Unfortunately, I am not sure when I will be able to do this.
For now, you will have to get into HJSON and JS if you want the input textarea field.
If your API provider supports it, you can set the key-value pairs in API DETAILS > Input Data section, instead of a JSON object.
@sid How do we go about installing this?
I’ve tried to add the gitlab repo in the extensions section of the Project Options but the API File upload Action is not showing up.