0

How do I send a request with headers in volley for Kotlin?

val stringRequest = StringRequest(com.android.volley.Request.Method.GET,url,Response.Listener { response ->
        textoResultado = "La respuesta es: ${response}"
        Log.d("Esto dice",textoResultado)
    },Response.ErrorListener {
        textoResultado = "Algo salio mal"
    })
idris
  • 1,019
  • 1
  • 9
  • 22

1 Answers1

0

Synopsis:

  • Add an object keyword
  • then override behaviour of the getHeaders function

Two good examples here:

  1. https://adnan-tech.com/pass-headers-with-volley-android-kotlin
  2. https://stackoverflow.com/a/53141982/1847378
AndrewL
  • 2,034
  • 18
  • 18