title: Why does flutter's http.get function make the server return http error code 409? Invoking the exact same url on the browser returns status code 200
body: <p>My Flutter method that makes the http request. It even prints out the http url and invoking this same exact url on the browser returns status code 200 yet calling it programmatically using flutter's http.get returns error code 409.</p>
  
  <pre><code> Future&lt;String&gt; saveUser(String firstName, String lastName, String sex) async {
      String url = domain +
          'register?' +
          'first_name=' +
          firstName +
          '&amp;last_name=' +
          lastName +
          '&amp;sex=' +
          sex;
      final response = await http.get(url);
      print(url);
      print(response.statusCode);
      print(response.body);
      if (response.statusCode == 200) {
        // If server returns an OK response, parse the JSON.
        return response.body;
      } else {
        // If that response was not OK, throw an error.
        return 'Failed to Register User';
      }
    }
  </code></pre>
  
  <p>This is flutter's console log. the number represents the error code, and the 'script' tags represent the response body</p>
  
  <pre><code>I/flutter (27919): http://filteredkenya.co.ke/baliach/register?first_name=Tyler&amp;last_name=Mutai&amp;sex=Male
  I/flutter (27919): 409
  I/flutter (27919): &lt;script&gt;document.cookie = "humans_21909=1"; document.location.reload(true)&lt;/script&gt;
  
  </code></pre>
  
  <p>This is my Laravel's Controller method that's supposed to save data to DB and return a response (Has been mapped to both get and post methods):</p>
  
  <pre><code>public function register(Request $request)
      {
          $data = $request-&gt;all();
          //Validation:
          $validator = Validator::make($data, [
              'first_name' =&gt; 'required|string|min:3',
              'last_name' =&gt; 'required|string|min:3',
              'sex' =&gt; 'required|string|min:3',
          ]);
  
          //If there is an error in either one of the inputs
          if ($validator-&gt;fails()) {
              return response()-&gt;json($validator-&gt;errors());
          }
          $registration = new Registration;
          $registration-&gt;first_name = $data['first_name'];
          $registration-&gt;last_name = $data['last_name'];
          $registration-&gt;sex = $data['sex'];
          $registration-&gt;save();
  
          return response()-&gt;json($data);
      }
  </code></pre>