title: How to send http post request with an Avro file?
body: <p>I have a flask api that is expecting a post request in Avro. The problem is I'm not sure how to send Avro requests to test it. The api reads the data using the fastavro.reader(io.BytesIO(request.data))</p>
  
  <p>I have tried using postman:
  In the header defining Content-Type as "avro/binary"
  However looks like its not possible 
  <a href="https://github.com/postmanlabs/postman-app-support/issues/4435" rel="nofollow noreferrer">https://github.com/postmanlabs/postman-app-support/issues/4435</a></p>
  
  <p>I also tried curl:</p>
  
  <pre><code>curl -X POST -H "Content-Type: avro/binary" --data "{"city": "ALA",
  "number_of_points": 42, "transport": "CAR", "subtype": "PURCHASE"}"
  "http://localhost:8080/invocations"
  </code></pre>
  
  <p>However fastavro returns the following error:</p>
  
  <p>File "fastavro/_read.pyx", line 725, in fastavro._read.file_reader.<strong>init</strong></p>
  
  <p>ValueError: cannot read header - is it an avro file?</p>
  
  <p>Resources:</p>
  
  <p><a href="https://github.com/fastavro/fastavro" rel="nofollow noreferrer">https://github.com/fastavro/fastavro</a></p>
  
  <p><a href="https://avro.apache.org/" rel="nofollow noreferrer">https://avro.apache.org/</a></p>