I'm trying to upload a file using the REST API. It indicates that I need to include a location. In the example, I don't see where the location would be specified as either a form field or otherwise in the header. Here is the example I'm referring to:
POST /api/files/sdcard HTTP/1.1
Host: example.com
X-Api-Key: abcdef...
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDeC2E3iWbTv1PwMC------WebKitFormBoundaryDeC2E3iWbTv1PwMC
Content-Disposition: form-data; name="file"; filename="whistle_v2.gcode"
Content-Type: application/octet-streamM109 T0 S220.000000
T0
G21
G90
...
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
Content-Disposition: form-data; name="select"true
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
Content-Disposition: form-data; name="print"true
------WebKitFormBoundaryDeC2E3iWbTv1PwMC--
I was trying to post locally, so the first line would be the following if I am understanding correctly (by the way, the docs indicate that uploading to SD cards is not yet implemented, yet it appears that the example is for SD cards):
POST /api/files/local HTTP/1.1
If the location is appended to that, then it might be something like:
POST /api/files/local/funProject HTTP/1.1
If it is a form variable, then it would be the following:
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
Content-Disposition: form-data; name="location"funProject
Any assistance is appreciated!