title: Using guzzle to send post request to laravel based apps
body: <p>I'am having 2 laravel apps in my localhost (for testing purpose)... and I want my first laravel apps send POST data to my second laravel apps and then save those data to mysql database.</p>
  
  <p>So here is my first laravel apps route</p>
  
  <pre class="lang-php prettyprint-override"><code>Route::get('post_request', function()
  {  
  
      $client = new \GuzzleHttp\Client();
      $url = "http://bkculv5.local/api_post";
  
      $response = $client-&gt;post($url,[
          'json'=&gt;[
              'judul' =&gt; 'title','content' =&gt; 'konten'
          ]]);
  
  });
  </code></pre>
  
  <p>and here is my second laravel apps route</p>
  
  <pre class="lang-php prettyprint-override"><code>Route::post('/api_post', function(Request $request){
      $judul = $request-&gt;judul;
      $content = $request-&gt;content;
  
      $artikel = new App\Artikel;
      $artikel-&gt;judul = $judul;
      $artikel-&gt;content = $content;
  
      $artikel-&gt;save();
  });
  </code></pre>
  
  <p>and what I get is </p>
  
  <blockquote>
    <p>Server error: <code>POST http://bkculv5.local/api_post</code> resulted in a <code>500
    Internal Server Error</code> response:</p>
  </blockquote>
  
  <p>When I put <code>myfirstapplaravel.local/api_post</code> into browser</p>
  
  <p>Any idea why? or do i need to use X-CSRF-TOKEN like when using post in ajax?</p>
  
  <h3>Update</h3>
  
  <p>Here is my error logs in apache xampp</p>
  
  <pre><code>[Thu Jul 20 15:26:35.201109 2017] [core:error] [pid 1500:tid 604] (EAI 11002)APR does not understand this error code: AH00549: Failed to resolve server name for 36.86.63.180 (check DNS) -- or specify an explicit ServerName
  [Thu Jul 20 15:26:35.439807 2017] [ssl:warn] [pid 1500:tid 604] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
  [Thu Jul 20 15:26:35.487845 2017] [mpm_winnt:notice] [pid 1500:tid 604] AH00354: Child: Starting 150 worker threads.
  </code></pre>