Hello, I try to add `Authorization` header to ajax...
# kvision
j
Hello, I try to add
Authorization
header to ajax request from tabulator but my configuration is ignored. What is the good syntax ?
Copy code
tabulator<Any>(
    TabulatorOptions(
        ajaxURL = "${Api.API_URL}/product",
        ajaxConfig = "POST",
        ...
    )
)
Request is a POST
Copy code
tabulator<Any>(
    TabulatorOptions(
        ajaxURL = "${Api.API_URL}/product",
        ajaxConfig = object : Tabulator.AjaxConfig {
            override var method: String = "POST"
            override var headers: dynamic = mapOf("Authorization" to token)
        },
        ...
    )
)
Request is a GET instead of POST (and Authorization header isn't added)
r
Copy code
ajaxConfig = obj {
                method = "POST"
                headers = obj {
                    Authorization = token
                }
            }
j
Oh ! Thank you