title: Batch Request in python to Google Search Console API
body: <p>For the past two days I've been trying to send a batch request to Google Search Console API in Python but I am unsure of the documentation and how to proceed. </p>
  
  <p>I'm not sure which documents to follow.</p>
  
  <p><a href="https://developers.google.com/api-client-library/python/guide/batch" rel="noreferrer">https://developers.google.com/api-client-library/python/guide/batch</a></p>
  
  <p><a href="https://developers.google.com/webmaster-tools/v3/how-tos/batch" rel="noreferrer">https://developers.google.com/webmaster-tools/v3/how-tos/batch</a></p>
  
  <p>The first document says to use this format:</p>
  
  <pre><code>from apiclient.http import BatchHttpRequest
  
  def insert_animal(request_id, response, exception):
    if exception is not None:
      # Do something with the exception
      pass
    else:
      # Do something with the response
      pass
  
  service = build('farm', 'v2')
  
  batch = service.new_batch_http_request(callback=insert_animal)
  
  batch.add(service.animals().insert(name="sheep"))
  batch.add(service.animals().insert(name="pig"))
  batch.add(service.animals().insert(name="llama"))
  batch.execute(http=http)
  </code></pre>
  
  <p>but the second post says to do this:</p>
  
  <pre><code>POST /batch HTTP/1.1
  Authorization: Bearer your_auth_token
  Host: www.googleapis.com
  Content-Type: multipart/mixed; boundary=batch_foobarbaz
  Content-Length: total_content_length
  
  --batch_foobarbaz
  Content-Type: application/http
  Content-ID: &lt;item1:12930812@barnyard.example.com&gt;
  
  GET /farm/v1/animals/pony
  
  --batch_foobarbaz
  Content-Type: application/http
  Content-ID: &lt;item2:12930812@barnyard.example.com&gt;
  
  PUT /farm/v1/animals/sheep
  Content-Type: application/json
  Content-Length: part_content_length
  If-Match: "etag/sheep"
  
  {
    "animalName": "sheep",
    "animalAge": "5"
    "peltColor": "green",
  }
  
  --batch_foobarbaz
  Content-Type: application/http
  Content-ID: &lt;item3:12930812@barnyard.example.com&gt;
  
  GET /farm/v1/animals
  If-None-Match: "etag/animals"
  
  --batch_foobarbaz--
  </code></pre>
  
  <p>but I'm not sure the last one wants me to do with this code?</p>
  
  <p>Also, when trying to make a Post request in Request package, where can I enter a body parameter?</p>
  
  <p>Thank you.</p>