You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like the .attach('attachments[]', fs.createReadStream('/path/to/file1.ext'))
creates an error in my reqeuest. I got a 400 response with complains about some fields which are set:
{ description: 'Validation failed', errors: [ { field: 'description', message: 'It should be a/an String', code: 'missing_field' }, { field: 'status', message: 'It should be one of these values: \'2,3,4,5,6,7\'', code: 'missing_field' }, { field: 'subject', message: 'It should be a/an String', code: 'missing_field' }, { field: 'priority', message: 'It should be one of these values: \'1,2,3,4\'', code: 'missing_field' }, { field: 'requester_id', message: 'Please fill at least 1 of requester_id, phone, email, twitter_id, facebook_id fields', code: 'missing_field' }, { field: 'type', message: 'It should be one of these values: \'Question,Problem,Feature Request,Praise,Complain\'', code: 'missing_field' } ] }
When I comment out all the .attach lines the ticket is created correctly. The files are present in the path.
I get the same issue with PHP, attaching a file, with a custom header for 'Content-type: multipart/form-data' results in all ticket fields reported as missing, even though they're in the same data array as 'attachments[]'
Seems like the
.attach('attachments[]', fs.createReadStream('/path/to/file1.ext'))
creates an error in my reqeuest. I got a 400 response with complains about some
fields
which are set:When I comment out all the
.attach
lines the ticket is created correctly. The files are present in the path.My unirest request looks like this:
The text was updated successfully, but these errors were encountered: