I'm trying to create a submission page in which part of includes the option to submit a file. I am able to use the API to submit normal text info (dates/numbers/prices/etc.), but submitting files is some what of an issue. Currently, this is what I have:
The code that retrieves the file and calls the API request
Now before I get this as a response, yes I have viewed almost every page on Caspio's site for documentation on rest API v2 and v1, but the problem is that none of it has any concrete examples of code for making this request in v2. The swagger site and its documentation also doesn't help my case for the same reason. I have switched the content-type from application/json to multipart/form-data and back, I have attempted adding Access Control headers, but all of it results in a failed request (returning POST 400, POST 415, or an issue with CORS policy). Does anyone know what I'm doing wrong, or has an example that I could potentially pull from?
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
teltz
Hi there!
I'm trying to create a submission page in which part of includes the option to submit a file. I am able to use the API to submit normal text info (dates/numbers/prices/etc.), but submitting files is some what of an issue. Currently, this is what I have:
The code that retrieves the file and calls the API request
The API request itself:
Now before I get this as a response, yes I have viewed almost every page on Caspio's site for documentation on rest API v2 and v1, but the problem is that none of it has any concrete examples of code for making this request in v2. The swagger site and its documentation also doesn't help my case for the same reason. I have switched the content-type from application/json to multipart/form-data and back, I have attempted adding Access Control headers, but all of it results in a failed request (returning POST 400, POST 415, or an issue with CORS policy). Does anyone know what I'm doing wrong, or has an example that I could potentially pull from?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.