title: Download image/png - RCurl
body: <p>I'm trying to use Clearbit.com's free logo API (<a href="https://logo.clearbit.com/:domain" rel="nofollow">https://logo.clearbit.com/:domain</a>) to download the a few company logos. </p>
  
  <p>To try out the tool, simply paste <a href="https://logo.clearbit.com/nike.com" rel="nofollow">https://logo.clearbit.com/nike.com</a> into your web browser. </p>
  
  <p>The goal is to save the Response from a GET request as a PNG file. Here is a an example of the code I'm using, which fails.</p>
  
  <pre><code>    library(RCurl)
      url &lt;- "https://logo.clearbit.com/basf.com"
      png &lt;- getURL(url, httpheader = "image/png", ssl.verifypeer = F)
  </code></pre>
  
  <p>This produces the following error message:</p>
  
  <pre><code>    Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) : 
      embedded nul in string:'‰PNG\r\n\032\n\0\0\0\rIHDR\0\0\0\0\0\0\b\006\0\0\0Ã&gt;aË\0\0\0\004gAMA\0\0±\vüa\005\0\0\0 cHRM\0\0z&amp;\0\0€„\0\0ú\0\0\0€è\0\0u0\0\0ê`\0\0:˜\0\0\027pœºQ&lt;\0\0\0\006bKGD\0ÿ\0ÿ\0ÿ ½§“\0\0\0\atIME\aß\006\036\022\0228_nn\005\0\0\027$IDATxÚíyx[Õ÷?÷^IW»dË–÷5v\026'qœ•¤$!%$¡P(]\030Z†y™2CK\aZ\006ž–ç-Ó…¶Ó&gt;}g\nÃ¼¥lçi¡e:L\031\030(…°¦¤$$„fOììÞâ}·,YÒ]æ\017+"ŠäÄÄv3É½Ÿ&lt;y\022stîÑ9ß{öó;Âë‡ŸÔ11,â…N€É…Å\024€Á1\005`pL\001\030\034S\0\006Ç\024€Á1\005`pL\001\030\034S\0\006Ç2•‘9­^&lt;r\016ƒ£Œ*#IwQÈu•eüNgèxòÿ’hÁoÏG\024$B±&gt;"ñá\v?—&lt;S(\0êœË\bºËÙÛþ\026£§\025¬WÎ¡¶`mÆo½qd,œßžÇü‚µØ-®¤_W¨‘\003›Q´è…Î§K–I\vÀ#çà·ç‘ï©ÄïÈÏ\030ÆkÏ\005 y`?]¡¦4\177I´RW¸\036«dçP÷{Œ*#ÌÊ]NÐ]Žª)ìïÜt¡óé’eÒ\002(òÎ¢Ä_sÖ0.[\026\0ý‘\016ú#miþ9Î\022¬’þH;Í\003û\001\020\005‘ùùW’ç©à`×f4]M†\027\004‘ «\034€P¬‘Ø\00Ö„ä8K\023Ïj'¦FD+\005ž*|ö º®Ñ&gt;|,-\r\016«—|Ï\f\\6?è:‘ø0¡ã„bý\0Ø-.|ö&lt;¢Ê\b\021%D©\177. p¤g;N«—|O\025.›\017\035\030\036íáäÐá‹¦Öš´\0:C'\bÇ\a\001(ñÏÅiõ¦…q'\004à°z¨+\\(XÆ\n»\177\037ª®$kˆS\031\0160\020é\004Æú\017n9›¡
  </code></pre>
  
  <p>I've searched through the documentation, but I have not been able to remedy this, so please advise. </p>
  
  <p>P.S. This is my first post on stackoverflow, so feel free to pose suggestions on style and general guidelines.</p>
  
  <p>Thanks,
  Ryan</p>