title: Difference between HTTPServlet and APIMethod - AppEngine
body: <p>So I am trying to teach myself backend development and have gone with Google App Engine to help me.</p>
  
  <p><strong>My Question is:</strong>
  What is the difference between an HTTP Servlet and an API Method?</p>
  
  <p>They seem to do the same thing for me.
  Lets use the example of an app where you take brief notes on a client and send them to the server to process:</p>
  
  <pre><code>@ApiMethod(httpMethod = "POST")
  public final String sendShortNote(@Named("note") final String note) throws ServiceException {
      // Do POSTlike things here
  }
  </code></pre>
  
  <p>and setting up an HTTPServlet that handles doPost and retrieves the note from the body:</p>
  
  <pre><code>public class NoteServlet extends HttpServlet {
  
  @Override
  protected void doPost(HttpServletRequest req, HttpServletResponse resp)
          throws ServletException, IOException {
      req.getParameter("note");
      //continue to do things and return a response.
  }
  </code></pre>
  
  <p>From what I see, the Servlet allows me to add things to the HTTP body while the ApiMethod just adds the parameters as a query url, which makes the Servlet more secure?</p>
  
  <p>Also, the Servlet allows me to return multiple values through a response while the APIMethod only allows me to return a single value.</p>
  
  <p>Are these correct?</p>