Using invokeurl to upload files to Google Drive

Using invokeurl to upload files to Google Drive

I'm running into an issue when using invokeurl to attempt to upload files to Google Drive using the Google Drive API v3

When I run the code below I get this error: "Missing end boundary in multipart body"

However, I define the boundary string in the header, and include it in the parameters string.

When I run the same request in Postman, I get a successful response and it creates the file. Postman pics are attached.

How do I need to format this request in Deluge to get it working?

upload_headers = Map();
upload_headers.put("Content-Type","multipart/related; boundary=foo_bar_baz");
// upload_headers.put("Content-Length",file_size);
upload_params = "--foo_bar_baz"+"\n"+"Content-Type: application/json; charset=UTF-8"+"\n"+"{'name':'Zoho_test.txt','parents':['1ZfH6_HIkH1AH5liITcIUqxiR92KzOByY']}"+"\n"+"--foo_bar_baz"+"\n"+"Content-Type: text/plain"+"\n"+"This is a test document."+"\n"+"--foo_bar_baz--";
//Upload PDF HTTP request
//
upload_PDF_response = invokeurl
[
url :upload_PDF_url
type :POST
headers: upload_headers
parameters:upload_params.toText()
connection:"zohogdrive"
];
info upload_PDF_response;





                            Zoho Desk Resources

                            • Desk Community Learning Series


                            • Digest


                            • Functions


                            • Meetups


                            • Kbase


                            • Resources


                            • Glossary


                            • Desk Marketplace


                            • MVP Corner


                            • Word of the Day



                                Zoho Marketing Automation


                                        Manage your brands on social media



                                                Zoho TeamInbox Resources

                                                  Zoho DataPrep Resources



                                                    Zoho CRM Plus Resources

                                                      Zoho Books Resources


                                                        Zoho Subscriptions Resources

                                                          Zoho Projects Resources


                                                            Zoho Sprints Resources


                                                              Qntrl Resources


                                                                Zoho Creator Resources


                                                                  Zoho WorkDrive Resources



                                                                    Zoho Campaigns Resources

                                                                      Zoho CRM Resources

                                                                      • CRM Community Learning Series

                                                                        CRM Community Learning Series


                                                                      • Tips

                                                                        Tips

                                                                      • Functions

                                                                        Functions

                                                                      • Meetups

                                                                        Meetups

                                                                      • Kbase

                                                                        Kbase

                                                                      • Resources

                                                                        Resources

                                                                      • Digest

                                                                        Digest

                                                                      • CRM Marketplace

                                                                        CRM Marketplace

                                                                      • MVP Corner

                                                                        MVP Corner




                                                                            Design. Discuss. Deliver.

                                                                            Create visually engaging stories with Zoho Show.

                                                                            Get Started Now