Skip to main content
Published: August 09 2006, 2:34:00 PMUpdated: November 28 2020, 2:23:03 PM

I am getting an HTTP 501 error response that is not formatted in XML, much like this:

<html><head><title>Apache Tomcat/5.5.15-150 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 501 - Method post is not defined in RFC 2068 and is not supported by the Servlet API </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Method post is not defined in RFC 2068 and is not supported by the Servlet API </u></p><p><b>description</b> <u>The server does not support the functionality needed to fulfill this request (Method post is not defined in RFC 2068 and is not supported by the Servlet API ).</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.15-150</h3></body></html>

What can I do about this?

You will need to use "POST" as your Method when making the API call.
If you use "post" or some other mixed case, you will likely get this error.

The API adheres strictly to the requirement found in RFC 2068 for the Method.
Here is the entry from RFC 2068 (note that the method is case-sensitive):

5.1.1 Method

The Method token indicates the method to be performed on the resource
identified by the Request-URI. The method is case-sensitive.

Method = "OPTIONS" ; Section 9.2
| "GET" ; Section 9.3
| "HEAD" ; Section 9.4
| "POST" ; Section 9.5
| "PUT" ; Section 9.6
| "DELETE" ; Section 9.7
| "TRACE" ; Section 9.8
| extension-method

extension-method = token

The list of methods allowed by a resource can be specified in an
Allow header field (section 14.7). The return code of the response
always notifies the client whether a method is currently allowed on a
resource, since the set of allowed methods can change dynamically.
Servers SHOULD return the status code 405 (Method Not Allowed) if the
method is known by the server but not allowed for the requested
resource, and 501 (Not Implemented) if the method is unrecognized or
not implemented by the server. The list of methods known by a server
can be listed in a Public response-header field (section 14.35).

The methods GET and HEAD MUST be supported by all general-purpose
servers. All other methods are optional; however, if the above
methods are implemented, they MUST be implemented with the same
semantics as those specified in section 9.

How well did this answer your question?
Answers others found helpful