title: POST of json over Flask API wont accept my argument
body: <p>I have a problem with POSTing a JSON to my API...</p>
  
  <p>API:</p>
  
  <pre><code>app = Flask(__name__)
  cors = CORS(app, resources={r"/*": {"origins": "*"}})
  
  @app.route("/")
  def hello():
      return jsonify({"about":"Hello wwworld"})
  
  @app.route('/json-example', methods=['POST']) #GET requests will be blocked
  def json_example():
  
      req_data = request.get_json()
  
      return jsonify(req_data)
  </code></pre>
  
  <p>AXIOS in Vue:</p>
  
  <pre><code>  &lt;script&gt;
      var app = new Vue({
        el: '#app',
        data: {
          message: 'Hello Vue!',
          result:'',
          test:   {
                  "language" : "Python",
                  "framework" : "Flask",
                  "website" : "Scotch",
                  "version_info" : {
                      "python" : 3.4,
                      "flask" : 0.12
                  },
                  "examples" : ["query", "form", "json"],
                  "boolean_test" : true
              }
        },
        methods:{
  
          getResults () {
              axios.get(`http://127.0.0.1:5000/`)
              .then(response =&gt; {this.result = response.data})
              .catch(error =&gt; {
                console.log(error)
              })
          },
  
          getResults2 () {
              axios.post(`http://127.0.0.1:5000/json-example`, {
                params: {
                  test
                }
              })
              .then(response =&gt; {this.result = response.data})
              .catch(error =&gt; {
                console.log(error)
              })
          }
  
        }
      })
    &lt;/script&gt;
  </code></pre>
  
  <p>For some reason i cant access <strong>test</strong> json that i would like to pass as an argument. First function getResults () works just fine but when I try getResults ()2 it gives me following error:</p>
  
  <blockquote>
    <p>index.html:45 Uncaught ReferenceError: test is not defined</p>
  </blockquote>
  
  <p>Can somone please give me a hint how to fix it? I tried posting the json via Postman ans got a proper reponse.</p>
  
  <p>Thank you
  Jakub</p>