title: How to post to an API using aspnet 2.0
body: <p>A service a subscribed to uses an api and provided this sample php bellow.
  I have an old aspnet script which i want to modify to do the same but as i am not a programmer and having hard time with it. i read about httpclient and various codes but non do exactly what i need. Can this be easily ported?  thanks /J</p>
  <pre><code>    $client = new \GuzzleHttp\Client();
  $response = $client-&gt;post(&quot;https://api.domain.com/v3/accounts&quot;, [
      'headers' =&gt; [
              &quot;Authorization&quot; =&gt; &quot;Bearer {token}&quot;,
              &quot;Accept&quot; =&gt; &quot;application/json&quot;,
              &quot;Content-Type&quot; =&gt; &quot;application/json&quot;,
          ],
      'json' =&gt; [
              &quot;username&quot; =&gt; &quot;eius&quot;,
              &quot;password&quot; =&gt; &quot;nemo&quot;,
          ],
  ]);
  $body = $response-&gt;getBody();
  print_r(json_decode((string) $body));
  </code></pre>