I'm writing a small app. Here is the code snippet.

**Javascript:**

```
<script type="text/javascript">
function filldata()
{
    var sample = document.getElementById("filter-select").value;
    jQuery.support.cors = true;
    $.post("/test",{"filter_type":sample},function(data,status)
    {
    alert(data);
    });
}
</script>

```

**Flask Code:**

```
@app.route('/test', methods=['POST'])
def test(str):
    return str

```

It is giving me `500 internal error`.  

When I run this in debug mode, it is saying:

```
test() takes exactly one argument(zero given)

```