title: React JS Unexpected end of JSON input error when binding data from an API
body: <p>I have a select-dropdown-list, it's data is generated from a API/json file. The json resembles the following:</p>
  
  <pre><code>[
      {
          "id": 444,
          "ggg_progid": "0000-111-222-333-44444",
          "clientName": "client 1- aaa-bb-01-05 - AA"
      }
  ]
  </code></pre>
  
  <p>...but I get the error, Unhandled Rejection (SyntaxError): Unexpected end of JSON input, when I run my code using a particular url for the API/json file. So when I copy the code from the API and paste it into myjson.com, then use the url provided by myjson.com, my code works fine. </p>
  
  <p>What could the problem be, both API's have the same json syntax?</p>
  
  <p>Just in case, I provided the code below:</p>
  
  <pre><code>import React, { Component } from 'react';
  
  class Ast extends Component {
  
     constructor(){
         super();
         this.state = {
             data: [],
         };
     } //end constructor
  
      componentDidMount() {
          fetch('http://myapi/:1234/api/clients', {
              method: 'GET',
              headers: {
                  'Content-type': 'application/json',
                  'Authorization': 'Bearer abc123def.abc123def.abc123def'
              },
          })
          .then(results =&gt; results.json())
          .then(data =&gt; this.setState({ data: data }))
      }
  
      render() {
      console.log(this.state.data);
      return (
      &lt;div&gt;
          &lt;div className="container"&gt;
              &lt;form&gt;
              &lt;h2&gt;Memeber Selection:&lt;/h2&gt;
              &lt;div&gt;
                  {
                      this.state.data.map(item =&gt;(
                          &lt;div&gt;
                              &lt;select className="custom-select" id="clientName"&gt;&gt;
                              &lt;option key={item.clientName}&gt;{item.clientName}&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
                      ))
                  }
              &lt;/div&gt;
              &lt;div&gt;
              &lt;button type="submit" className="btn btn-primary"&gt;Submit&lt;/button&gt;
              &lt;/div&gt;
              &lt;/form&gt;
          &lt;/div&gt; 
      &lt;/div&gt;
          );
        }
  }
  
  export default Ast
  </code></pre>
  
  <p>I took the failing URL and pasted it into postman, and it renders results. Any ideal why an error is generated when I use the url in my code?</p>