title: Advice for learning how to use httr to access API
body: <p>I am trying to learn how to use <code>httr</code> to access an SMS service's API. The package documentation is helpful, but I think I lack an understanding of some important higher level concepts. Could someone point me to a good tutorial for using <code>httr</code>? </p>
  
  <p>In case it is helpful in directing me to the right type of resource, here is an example of a url I am trying to use from the service provider's API documentation (account is not active):</p>
  
  <pre><code>http://sms.shujaa.mobi/sendsms?username=info%40shujaa.co.ke&amp;password=info&amp;account=developer&amp;source=2024&amp;destination=254717555555&amp;message=This%20is%20a%20test.&amp;network=safaricom
  </code></pre>
  
  <p>My first inclination was to define each object and then paste together the string.</p>
  
  <pre><code>library(httr)
  
  url &lt;- "http://sms.shujaa.mobi/sendsms"
  username &lt;- "info%40shujaa.co.ke"                    
  password &lt;- "info&amp;account"                   
  account &lt;- "developer"
  source &lt;- "2024"                        
  destination &lt;- "254717555555"
  message &lt;- "This%20is%20a%20test."
  network &lt;- "safaricom"
  
  send &lt;- paste0(url, "?", "username=", username, "&amp;password=", password, "&amp;account=",
             account, "&amp;source=", source, "&amp;destination=", destination, "&amp;message=", message,
             "&amp;network=", network)
  
  POST(send)
  </code></pre>
  
  <p>I don't think this is the correct approach. I think I should be using some of the arguments of POST to modify the url with the necessary info, but I'm not seeing the bigger picture. I think an example or two might help me move in the right direction. The included demos don't seem to address my confusion.</p>