ALM REST API, add attachment

Hi there,

I have problems with the upload of attachments to ALM via the REST API.

I allways get an internal error (500).

Does anyone has a clue what's the probem witht t

he request?

It looks like the example in the api documentation.

HTTP/1.1 100 Continue

POST /qcbin/rest/domains/CUSTOMER/projects/PROJECT/attachments HTTP/1.1
Content-Type: multipart/form-data; boundary=--uploadboundary
Accept: application/json
Accept-Language: en-US
Accept-Encoding: gzip, deflate
Host: msapp02p:8080
Cookie: LWSSO_COOKIE_KEY=Hamk5ipknjPhHBh8qe6v4S63lnCwYnFmzYEZ33o4NaycQXiMMLz7_LHICnId76Y_IQw-d9RzHeQT7buzHb9cN3c61uEeQSxMlumQwnLMP90S3RD9ecSzycsgz_RlKfV3JgMQC1pyyQiTj1pzrdi5FnWROp_hT4vZkmNfPmM95WSySzNzX3N9L0u9ctqv_RcTwk90AtJTt_P_HHsOKc8NuLlZ98vma-Qyp0CDuUcWoXdYawOndsdRyUUAHgfFX6IoYJtwTSFdwN9BPsciRgX0zfzpeWVoOJnQm4oJnGaaiGs.; QCSession=NjMyODM4O29vQUU2R2Jwbm9jblF6am1XSE5qcHcqKjtSRVNUIGNsaWVudDsgOyA.; ALM_USER=72cbc27efa8f4f748a37d85b07d99f9a31ec7e677ae6f4e1cec9425451e63a21; XSRF-TOKEN=6413199b7c87c0826ab3a0b6ccf92257bb5391af9843ced7d5f236d7536cc6b0
Content-Length: 407
Expect: 100-continue

name="entity.type"
defect
--uploadboundary
Content-Disposition: form-data; name="entity.id"
846
--uploadboundary
Content-Disposition: form-data; name="description"
Testanhang
--uploadboundary
Content-Disposition: form-data; name="filename"
test.txt
--uploadboundary
Content-Disposition: form-data; name="file"; filename="test.text"
Content-Type: text/plain
das ist ein test
--uploadboundary--

HTTP/1.1 500 Server Error
Date: Tue, 29 Aug 2017 12:56:53 GMT
X-Content-Type-Options: nosniff
Set-Cookie: LWSSO_COOKIE_KEY=5WhsRQTHKQBqAIvmMc7hsYbkjWzWO4n-iwfuQqULzfrFBXYMAsbEyeLAWM4q6dzoCBMRhmjOpR8LRw0T69TBp7GTe9XcdVi9CL8RufiTqXrkc46oavyghmVihQc-YQeXHLdWJ55xn2ERLvm_7cJ5T_SZnjzk_9wDctaLNn1C_mPQriqBqeIjgDFiCwCtlpPFPfcYbUnggSU7l57EZTUkFL5swBWa3or3L1qUoYgBMS-rx7o6o6ly6qJyrCeG_RPXxQysj1qcsu8nKMJknbdOmjYxZQXP9n0YmDY64QuVFdc.;Path=/;HTTPOnly
Set-Cookie: JSESSIONID=121hm6dk7x1uvdkkd4xm2hfxe;Path=/qcbin;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: application/json
X-XSS-protection: 1; mode=block
Content-Length: 114
Server: Jetty(9.1.4.v20140401)

{"Id":"qccore.general-error","Title":"String index out of range: -1","ExceptionProperties":null,"StackTrace":null}

Tags: