retrofit 2 @headers error in kotlin
Braces {}
isn't needed inside @Headers
.
Docs: https://kotlinlang.org/docs/reference/annotations.html#arrays-as-annotation-parameters
Use below code:
@Headers(
"Accept: application/json",
"Content-type:application/json"
)
You should use:
@Headers(value = ["Accept: application/json",
"Content-type:application/json"])
because the headers need an array parameter for it, you are using the wrong syntax in kotlin