title: XML request and response with fetch?
body: <p>The Postal Service has an API that allows you to send an xml request with package weight, travel info, etc. It will return back an xml response. </p>
  
  <p>How do I handle the xml response? I either need to parse the xml on the client-side, or more preferably, put the xml in a variable that I can send to my laravel backend for parsing.  </p>
  
  <p>Btw, I'm using react and laravel.</p>
  
  <pre><code>getPostagePrice = () =&gt; {
    fetch('http://production.shippingapis.com/ShippingApi.dll?API=RateV4&amp;XML=&lt;RateV4Request USERID="XXXXXXXXXXX"&gt;&lt;PackageID="1ST"&gt;&lt;Service&gt;PRIORITY&lt;/Service&gt;&lt;ZipOrigination&gt;44106&lt;/ZipOrigination&gt;&lt;ZipDestination&gt;20770&lt;/ZipDestination&gt;&lt;Pounds&gt;1&lt;/Pounds&gt;&lt;Ounces&gt;8&lt;/Ounces&gt;&lt;Container&gt;NONRECTANGULAR&lt;/Container&gt;&lt;Size&gt;LARGE&lt;/Size&gt;&lt;Width&gt;15&lt;/Width&gt;&lt;Length&gt;30&lt;/Length&gt;&lt;Height&gt;15&lt;/Height&gt;&lt;Girth&gt;55&lt;/Girth&gt;&lt;/Package&gt;&lt;/RateV4Request&gt;', {
         method: 'get',
     }).then((response) =&gt; {
         console.log(response.text());
     }).then(str =&gt; (new window.DOMParser()).parseFromString(str, "text/xml")
     ).then(data =&gt; console.log(data));
  }
  </code></pre>