title: C# POST JSON Request to Google Vision
body: <p>Being locked on .NET 2.0, i can't use the GOOGLE VISION C# API which is only available since.NET 4.0.</p>
  
  <p>So I wanted to use this API with web request like this :</p>
  
  <pre><code>string webAddr = "https://vision.googleapis.com/v1/images:annotate?key=XXXXXXXXXXX";
  
  var httpWebRequest = (HttpWebRequest)WebRequest.Create(webAddr);
  httpWebRequest.ContentType = "application/json; charset=utf-8";
  httpWebRequest.Method = "POST";
  using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
  {
      string json = " { \"requests\": [ { \"image\": { \"content\": " + this.b64 + " }, \"features\": [ {\"type\": \"TEXT_DETECTION\" }] }] }";
  
      streamWriter.Write(json);
      streamWriter.Flush();
  }
  var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
  using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
  {
      var responseText = streamReader.ReadToEnd();
      Console.WriteLine(responseText); 
  }
  </code></pre>
  
  <p>The problem is that i permanently have a 400 return from google and after a lot of searching i can't find a solution.</p>
  
  <p>Can you give me a way to proceed to solve this problem please ?
  Thank you very much.</p>
  
  <p>(Sorry for bad english...)</p>