Skip to content

Fix Request method for multipart/form-data used in AdminMetaResourceNew#5

Open
aneesh-n wants to merge 2 commits intoCometBackup:mainfrom
zmanda:multipart-request-fix
Open

Fix Request method for multipart/form-data used in AdminMetaResourceNew#5
aneesh-n wants to merge 2 commits intoCometBackup:mainfrom
zmanda:multipart-request-fix

Conversation

@aneesh-n
Copy link
Contributor

I wasn't able to get AdminMetaResourceNew to work with the Request method in its current form. I kept getting - "Error returned from API (code 500): Internal error".
Had to modify the Request method to use m.CreateFormFile and http.NewRequest when "multipart/form-data" is used as contentType.
As a result AdminMetaResourceNew now expects "upload" input to be a path to the file instead of the file content.

If there is another way to get AdminMetaResourceNew to work in the current form, we can close this PR.

@aneesh-n
Copy link
Contributor Author

aneesh-n commented Aug 23, 2024

If we can add a license as a secret, we could potentially set up a test suite for this project with a dockerized server.

@mason-cometbackup
Copy link
Contributor

Hi @aneesh-n, thanks again for another great PR. We have reproduced the issue internally and are figuring out our next steps from here.

Just for comparison, the Comet PHP SDK had identified this AdminMetaResourceNew API as an edge case, and had added an explicit unit test for it: https://github.com/CometBackup/comet-php-sdk/blob/master/tests/ExampleTest.php#L215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants