network.upload with body parameters

Hi,

I whant to upload a .json file and at the same time include parameters in the request body such as userGuid, or deviceToken.

using network.request I can add body parameters, but I don’t know how to upload a file at the same time

and using network.upload I can upload the file but I don’t know how to include the parameters.

How can I achieve both?

Thanks for your help

Ernest.

The network.upload() API is designed for services that basically capture the raw data and stores it into a file.  Web services/PHP scripts,etc. that are going to take a “body” need to use HTTP POST to do so, and network.upload() isn’t designed to work with those types of web form handlers.  Look up multi-part upload form to find the parameters you need to use and just use network.request to do the upload.

The network.upload() API is designed for services that basically capture the raw data and stores it into a file.  Web services/PHP scripts,etc. that are going to take a “body” need to use HTTP POST to do so, and network.upload() isn’t designed to work with those types of web form handlers.  Look up multi-part upload form to find the parameters you need to use and just use network.request to do the upload.