Launchpad logo and name.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index ][Thread Index ]

[Launchpad-users] Updating bugs with the API


I'm trying to update bugs in Launchpad using the API, but every time I issue a PATCH call on, it returns either a "400 Bad Request", or a "401 Bad Request".

I'm not using the Python library, but rather direct HTTP calls. Here's an example:

$ openssl s_client -connect
[openssl stuff snipped]

PATCH /1.0/entomologist2/+bug/733006 HTTP/1.0
Authentication: OAuth [oauth snipped but the tokens are valid]
Content-Type: application/json
Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Content-Length: 27

{ "status" : "Incomplete" }

And it returns with:

HTTP/1.1 400 Bad Request
Date: Sat, 19 Mar 2011 18:28:48 GMT
Server: squid/2.7.STABLE7
Content-Type: text/html
Content-Length: 2185
X-Squid-Error: ERR_INVALID_REQ 0
X-Cache: MISS from
X-Cache-Lookup: NONE from
Via: 1.0 (squid/2.7.STABLE7)
Via: 1.0
Vary: Accept-Encoding
Connection: close

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "";> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ERROR: The requested URL could not be retrieved</title> <style type="text/css"><!-- %l body :lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; } :lang(he) { direction: rtl; float: right; } --></style> </head><body> <div id="titles"> <h1>ERROR</h1> <h2>The requested URL could not be retrieved</h2> </div> <hr> <div id="content"> <p><b>Invalid Request</b> error was encountered while trying to process the request:</p> <blockquote id="data"> <pre>PATCH /1.0/entomologist2/+bug/733006 HTTP/1.1
Authentication: OAuth [snipped again]
Content-Type: application/json
Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Via: 1.0
Connection: Keep-Alive
Content-Length: 27

{ &quot;status&quot; : &quot;Incomplete&quot; }</pre> </blockquote> <p>Some possible problems are:</p> <ul> <li><p>Missing or unknown request method.</p></li> <li><p>Missing URL.</p></li> <li><p>Missing HTTP Identifier (HTTP/1.0).</p></li> <li><p>Request is too large.</p></li> <li><p>Content-Length missing for POST or PUT requests.</p></li> <li><p>Illegal character in hostname; underscores are not allowed.</p></li> </ul> <p>Your cache administrator is <a href="mailto:webmaster%W";>webmaster</a>.</p> <br> </div> <hr> <div id="footer"> <p>Generated Sat, 19 Mar 2011 18:28:48 GMT by (squid/2.7.STABLE7)</p> <!-- ERR_INVALID_REQ --> </div> </body></html> closed

This happens if I use openssl to connect to the server directly, or if I use QNetworkAccessManager to issue a PATCH call directly. What am I doing wrong here? A GET call returns the information as the documentation says it should.


Matt Barringer, Software Engineer
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)       

This is the launchpad-users mailing list archive — see also the general help for mailing lists.

(Formatted by MHonArc.)