title: getting an internal server error when I try to make a request to a Seneca.js API using Axios
body: <p>I wrote a simple Seneca plugin that I will eventually use to listen for http messages:</p>
  
  <p>buyer.js</p>
  
  <pre><code>module.exports = function buyer (){
  
      this.add('role:buyer, action: acceptOffer', function(msg, respond){
          respond(JSON.stringify({answer: msg.id}))
      })
  }
  </code></pre>
  
  <p>When I run this with the following script:</p>
  
  <p>index.js</p>
  
  <pre><code>require('seneca')()
      .use(require('./designs/offer/roles/buyer.js'))
      .listen()
  </code></pre>
  
  <p>I can now send POST requests to <code>localhost:10101/act</code> and use the plugin:</p>
  
  <pre><code>curl -d '{"role": "buyer", "action": "acceptOffer", "id": "12"}' http://localhost:10101/act
  {"answer":"12"}
  </code></pre>
  
  <p>Here's where things get messy.  I now want to make this http request through a web app, so I use axios to make a request like this from a web page:</p>
  
  <p>App.vue</p>
  
  <pre><code>&lt;template&gt;
      &lt;div id="app"&gt;
          &lt;button @click="sendQuery"&gt;&lt;/button&gt;
      &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
   import axios from 'axios';
  
   export default {
       name: 'App',
       data(){
           return {
               postBody: {
                   id: '12',
                   role: 'buyer',
                   action: 'acceptOffer'
               }
           }
       },
       methods: {
           sendQuery: function(){
               var body = JSON.stringify(this.postBody)
               axios.post(`http://localhost:10101/act`, {
                   body: body
               })
           }
       }
   }
  &lt;/script&gt;
  </code></pre>
  
  <p>When I click the button to send the request, I get this error message from my browser console (after I enable CORS):</p>
  
  <pre><code>xhr.js?ec6c:178 POST http://localhost:10101/act 500 (Internal Server Error)
  dispatchXhrRequest @ xhr.js?ec6c:178
  xhrAdapter @ xhr.js?ec6c:12
  dispatchRequest @ dispatchRequest.js?c4bb:59
  Promise.then (async)
  request @ Axios.js?5e65:51
  Axios.(anonymous function) @ Axios.js?5e65:71
  wrap @ bind.js?24ff:9
  sendQuery @ App.vue?26cd:26
  boundFn @ vue.esm.js?efeb:190
  invoker @ vue.esm.js?efeb:2004
  fn._withTask.fn._withTask @ vue.esm.js?efeb:1802
  createError.js?16d0:16 Uncaught (in promise) Error: Request failed with status code 500
      at createError (createError.js?16d0:16)
      at settle (settle.js?db52:18)
      at XMLHttpRequest.handleLoad (xhr.js?ec6c:77)
  </code></pre>
  
  <p>Can anyone tell me why this works differently than curl?  Why can't I get my response?</p>