title: Is it possible to convert a cURL request to a VBA winHttpRequest?
body: <p>I have the request below, trying to get a paypal auth token to retrieve a transaction list from my account.</p>
  
  <pre><code>curl -v https://api.sandbox.paypal.com/v1/oauth2/token \
   -H "Accept: application/json" \
   -H "Accept-Language: en_US" \
   -u "client_id:secret" \
   -d "grant_type=client_credentials"
  </code></pre>
  
  <p>And I have gone this far:</p>
  
  <pre><code>Set objHTTP = New WinHttp.WinHttpRequest
  sURL = "https://api.sandbox.paypal.com/v1/oauth2/token"
  objHTTP.Open "POST", sURL, False
  'what should go here? is the POST request correct? Are -H in cURL for headers?
  objHTTP.send (sBody)
  </code></pre>
  
  <p>Can you help me get this working? Is there maybe an easier way to have the cURL requests "converted"?</p>
  
  <p>EDIT:</p>
  
  <pre><code>sURL = "https://api.sandbox.paypal.com/v1/oauth2/token"
  objHTTP.Open "POST", sURL, False
  objHTTP.SetRequestHeader "Content-Type", "application/json"
  objHTTP.SetRequestHeader "Accept", "application/json"
  User = "user"
  Password = "password"
  objHTTP.SetRequestHeader "Authorization", "Basic " &amp; Base64Encode(User + ":" + Password)
  </code></pre>
  
  <p>Runtime Error 5</p>
  
  <p>Invalid procedure call or arguement. Any ideas?</p>