Alex Rivera | Logout

App Engine : 400 - Your client has issued a malformed or illegal request

Asked 2010-07-30T16:51:24.763
34

I have been running into this error for the last 3 or 4 weeks making requests to app engine. Certain requests - especially HTTP DELETE requests, are having this error returned from the google server.

Others have reported the same error - with 3 outcomes I can locate

  1. It is caused by stale cookies - clear your cookies and it runs fine gmail help -
  2. It is caused by a malformed url - only cases I can find relate to urlfetch() - spaces in the url - App engine Group #1, App Engine Group #2
  3. No resolution - sporadic behaiour, IE only. App Engine Group #3, App Engine Group #4

I'm now getting this behaviour all the time, in every browser. I can completely clear down the cache/cookies etc. in Chrome, Firefox, Safari, restart the browser and still reliably get this error on the same requests, so I don't think its cookie related. In any case I can issue GET, POST & PUT requests no problem with the same cookie.

Given that it occurs reliably on specific DELETE requests, the malformed URL would seem the most likely, however my URL is really very simple, and works fine on the dev server

Firebug shows the request headers as (I've munged the keys as they contain identifying data, but did so by removing characters from the centre of the key - not either end to guarantee I didn't inadvert

Edit
Report

1 Answer

35

With an HTTP DELETE, the URI should fully identify the resource to be deleted. Sending additional data in the request body is unexpected, and on App Engine, unsupported:

Indeed, when the appspot frontends see a DELETE request that includes an body, such as your app, they return a 501. But, if you remove the body then it will serve a 200.

Based on the subsequent discussion, it looks like they decided 400 was more appropriate than 501. In any event, if you omit the body and move your entity key into the URI, you should be fine.

answered 2010-07-30T20:25:23.557

Your Answer