{ "id": "63777", "key": "TIMOB-3145", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-07T22:55:37.000+0000", "created": "2011-04-15T03:38:01.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-07T22:55:37.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

Currently there is no way to POST multipart messages using\nHTTPClient. Are there any plans to do so?

{html}", "attachment": [], "flagged": false, "summary": "Using multipart POST with HTTPClient", "creator": { "name": "andrecarregal", "key": "andrecarregal", "displayName": "Andre Carregal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "andrecarregal", "key": "andrecarregal", "displayName": "Andre Carregal", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "130156", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Need to discuss how we're going to break up XHR/HTTPClient going\nforward. Don't want to put multipart features in a single-request\narchitecture.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:38:02.000+0000", "updated": "2011-04-15T03:38:02.000+0000" }, { "id": "130157", "author": { "name": "andrecarregal", "key": "andrecarregal", "displayName": "Andre Carregal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Call me naive if you want, but what about keeping full\ncompatibility with the current API by using an optional second\nparameter for HTTPClient.send? I was thinking in something\nlike:

\n
\nHTTPClient.send(data, multipart)\n
\n

where data would have the current semantics and\nmultipart, if present, would be an Array with multiple\nfile objects and their properties:

\n
\n{\n   { name :'fieldname',\n     filename :'filename',\n     filedata :'filedata'\n     [, 'Content-Type' : 'content-type']\n     [, 'Content-Transfer-Encoding' : 'encoding']\n   },\n   { ... },\n   ...\n}\n
\n

The presence of multipart would also signal the need\nfor a multipart protocol instead of the default one. In that case\nthe function would change the response preamble accordingly and add\na functional boundary string.

\n

The function could also infer Content-Type for each\npart using the filename extension, so a full example could\nbe something like:

\n
\nvar avatardata = avatarfile.read();\nvar videodata = videofile.read();\n\nvar data = {name : 'a name', option : 'some value'};\nvar multipart = {\n   { name = 'avatar', filename = 'thumb.jpg',\n     filedata =  avatardata,\n     Content-Transfer-Encoding' : 'base64' },\n   { name = 'video',\n     filename = 'presentation.avi',\n     filedata = videodata }\n};\n\nHTTPClient.send(data, multipart);\n
{html}", "updateAuthor": { "name": "andrecarregal", "key": "andrecarregal", "displayName": "Andre Carregal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:38:02.000+0000", "updated": "2011-04-15T03:38:02.000+0000" }, { "id": "421325", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket due to time passed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-07T22:55:37.000+0000", "updated": "2017-06-07T22:55:37.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }