<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Recent Posts in Creating a ticket: Why a 400 Bad Request? | Unfuddle Community</title>
    <link>http://unfuddle.com/community</link>
    <description>Unfuddle Community Forums</description>
    <item>
      <guid isPermaLink="false">www.unfuddle.com/community:6:852:2430</guid>
      <title>Creating a ticket: Why a 400 Bad Request? replied by Joshua Frappier @ Tue, 23 Feb 2010 02:28:10 UTC</title>
      <link>http://www.unfuddle.com/community/forums/6/topics/852</link>
      <description>Thanks for providing such a detailed example. It was helpful in determining the source of your error.

You will notice that your request contains a header &quot;Content-Type: application/x-www-form-urlencoded&quot;. However, you are attempting to post XML. As such, your Content-Type header should rather be &quot;application/xml&quot;. If you change that you should find that the ticket creation happens without any problems.</description>
      <pubDate>Tue, 23 Feb 2010 02:28:10 UTC</pubDate>
      <author>Joshua Frappier</author>
    </item>
    <item>
      <guid isPermaLink="false">www.unfuddle.com/community:6:852:2436</guid>
      <title>Creating a ticket: Why a 400 Bad Request? replied by mtdowling @ Wed, 24 Feb 2010 03:13:53 UTC</title>
      <link>http://www.unfuddle.com/community/forums/6/topics/852</link>
      <description>Thanks for your assistance, Joshua.  I guess I just overlooked the Content-Type header.  I'll give that a shot and post back if I have any problems.  Thanks!

-Michael</description>
      <pubDate>Wed, 24 Feb 2010 03:13:53 UTC</pubDate>
      <author>mtdowling</author>
    </item>
    <item>
      <guid isPermaLink="false">www.unfuddle.com/community:6:852:2426</guid>
      <title>Creating a ticket: Why a 400 Bad Request? posted by mtdowling @ Sun, 21 Feb 2010 22:01:27 UTC</title>
      <link>http://www.unfuddle.com/community/forums/6/topics/852</link>
      <description>I'm trying to create a ticket using the API.  Even though a summary and priority are being specified, I'm receiving a 400 Bad Request response stating that priority and summary must be set.

Request:
--------

POST /api/v1/projects/1/tickets HTTP/1.1
Authorization: Basic XXX
User-Agent: XXX
Host: XXX.unfuddle.com
Accept-Encoding: deflate, gzip
Accept: application/xml
Content-Length: 179
Content-Type: application/x-www-form-urlencoded

&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;ticket&gt;&lt;component-id&gt;4&lt;/component-id&gt;&lt;priority&gt;3&lt;/priority&gt;&lt;summary&gt;Testing summary&lt;/summary&gt;&lt;description&gt;This is a test description&lt;/description&gt;&lt;/ticket&gt;


Response:
---------

HTTP/1.1 400 Bad Request
Date: Sun, 21 Feb 2010 21:52:31 GMT
Server: Apache
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.1.2
Cache-Control: no-cache
Set-Cookie: _unfuddle_session=XXX; domain=.unfuddle.com; path=/; expires=Sun, 21 Feb 2010 23:52:31 GMT; HttpOnly
Content-Length: 172
Status: 400
Vary: User-Agent
Connection: close
Content-Type: application/xml; charset=utf-8

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;errors&gt;
  &lt;error&gt;Priority can only be one of the following: 5, 4, 3, 2, 1&lt;/error&gt;
  &lt;error&gt;Summary can't be blank&lt;/error&gt;
&lt;/errors&gt;

Any ideas why this error is occurring even though the things it's complaining about are set in the request's entity body?</description>
      <pubDate>Sun, 21 Feb 2010 22:01:27 UTC</pubDate>
      <author>mtdowling</author>
    </item>
  </channel>
</rss>

