title: Upload and get Json response as a cURL call in C#
body: <p>I'm trying to upload a file to the hosting platform Lutim using C#. 
  In their documentation (<a href="https://git.framasoft.org/luc/lutim/wikis/API" rel="nofollow">https://git.framasoft.org/luc/lutim/wikis/API</a>) they are using a cURL call:</p>
  
  <pre><code>curl -F "format=json" -F "file=@/tmp/snap0001.jpg" https://lut.im
  </code></pre>
  
  <p>And get back the following response: </p>
  
  <pre><code>{
      "success": true,
      "msg": {
          "real_short": "abc",
          "short": "abc/def",
          "token": "ghijkl",
          "thumb": XXX,
          "filename": "myimage.png"
      }
  }
  </code></pre>
  
  <p>When I'm using WebClient, HttpWebRequest or WebRequest, like in this sample:</p>
  
  <pre><code>using (WebClient uploader = new WebClient())
  {
     var data = uploader.UploadFile(new Uri(url), fileName);
     var result = System.Text.Encoding.Default.GetString(data);
  }
  </code></pre>
  
  <p>I always get back the HTML content of the target page, and not a JSON response as with the cURL call. </p>
  
  <p>How can I get the same behavior of the cURL call in C#?
  (without having to call cURL from C#...)</p>