Back in February, user 'toml at bitstatement' (<a href="http://www.gossamer-threads.com/lists/engine?user=7874;list=rt">http://www.gossamer-threads.com/lists/engine?user=7874;list=rt</a>) posted a question about interfacing with RT from Ruby via REST. That thread is archived here:<div>
<a href="http://www.gossamer-threads.com/lists/rt/users/82898">http://www.gossamer-threads.com/lists/rt/users/82898</a></div><div><br></div><div>I am having a similar problem, but when I implemented the solution described in that thread, RT still won't accept the comment.</div>
<div><br></div><div>Request from my Ruby application (hostnames have been changed to protect the innocent):</div><div><br></div><div>-----snip-----</div><div><div><div>POST /REST/1.0/ticket/5702/comment HTTP/1.1</div><div>
Accept: application/xml</div><div>Content-Type: multipart/form-data; boundary="905815"</div><div>Cookie: RT_SID_RTNAME.80=132575bdeee36284a05518c9b8080edf; path=/</div><div>Cookie2: $Version="1"</div><div>
Host: <a href="http://rthost.somewhere.com">rthost.somewhere.com</a></div><div>Content-Length: 308</div><div><br></div><div><br></div><div>--905815</div><div>Content-Disposition: form-data; name="attachment.txt"; filename="attachment.txt"</div>
<div>Content-Type: text/plain</div><div><br></div><div>test attachment content</div><div>--905815</div><div>Content-Disposition: form-data; name="content"</div><div><br></div><div>Ticket: 5702</div><div>Action: comment</div>
<div>Text: Adding attachment(s).</div><div>Attachment: attachment.txt</div><div><br></div><div>--905815--</div><div>-----snip-----</div><div><br></div><div>And the response from RT:</div><div>-----snip-----</div><div>HTTP/1.1 200 OK</div>
<div>Date: Thu, 23 Apr 2009 02:22:53 GMT</div><div>Server: Apache/2.2.3 (Unix) mod_ssl/2.2.3 OpenSSL/0.9.7f PHP/5.2.6</div><div>mod_perl/2.0.4 Perl/v5.8.6</div><div>Transfer-Encoding: chunked</div><div>Content-Type: text/plain; charset=utf-8</div>
<div><br></div><div>40</div><div>RT/3.8.1 400 Bad Request</div><div><br></div><div># No attachment for attachment.txt.<br></div></div><div>-----snip-----</div><div><br></div><div>I assume from the RT error message that it is parsing the "content" form field, or else it wouldn't know to look for the attachment.txt file, but I can't figure out what's wrong. Anyone have any ideas?</div>
</div>