retrofit 2 @headers error in kotlin retrofit 2 @headers error in kotlin android android

retrofit 2 @headers error in kotlin


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