title: Google Cloud Tasks always set HttpMethod to GET when using HttpRequest as payload_type
body: <p>According to this documentation [ <a href="https://cloud.google.com/tasks/docs/creating-http-target-tasks" rel="nofollow noreferrer">https://cloud.google.com/tasks/docs/creating-http-target-tasks</a> ], one should be able to create tasks with type 'http_request' and 'http_method' set to 'POST', but the behavior is not the expected once the task is always created with method 'GET'.</p>
  
  <p>After having this issue while using the Python Client Library, I've decided to try the API directly and check if it was an issue with the library or with the API itself.</p>
  
  <p>Using the "Try this API" from the product's documentation page [ <a href="https://cloud.google.com/tasks/docs/reference/rest/v2beta3/projects.locations.queues.tasks/create" rel="nofollow noreferrer">https://cloud.google.com/tasks/docs/reference/rest/v2beta3/projects.locations.queues.tasks/create</a> ], I've tried to create similar tasks using both http_request and app_engine_http_request types and always setting the http_method to POST.</p>
  
  <p>If I set the request body like this:</p>
  
  <pre><code>{
    "task": {
      "appEngineHttpRequest": {
        "httpMethod": "POST",
        "relativeUri": "/test",
        "body": "c2hhbGxvdyBub3c="
      }
    }
  }
  </code></pre>
  
  <p>...the task is created and the method is POST, like expected. But, if I set the request body to:</p>
  
  <pre><code>{
    "task": {
      "httpRequest": {
        "httpMethod": "POST",
        "url": "https://httpstat.us/404",
        "body": "c2hhbGxvdyBub3c="
      }
    }
  }
  </code></pre>
  
  <p>...the task is created, but with method GET instead of POST.</p>
  
  <p>Here's what I get at my queue:</p>
  
  <p><a href="https://i.stack.imgur.com/UjgXo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UjgXo.png" alt="![Tasks in the queue.](https://drive.google.com/file/d/1cxWc43BiWDPOYekAmFMAcMZygG5dYmx6/view?usp=sharing)"></a></p>
  
  <p>I believe this is a bug, and that's why I'm reporting it here with tag google-apis-explorer as recommended at the support page.</p>
  
  <p>Anyway, if anyone could tell me if I'm doing something wrong or if there's any workaround in the meanwhile I would really appreciate.</p>
  
  <p>Thanks!</p>