I want to send an HTTP post about volley. According to IDE, I cannot overwrite the methods getBodyContentType and getBody, whether some examples on the net show this. What is the syntax (in braces) for it? What am I doing wrong?
error message: Modifier 'override' is not applicable to 'local function'
val textView = findViewById<TextView>(R.id.loginStatus)
val queue = Volley.newRequestQueue(this)
val url = "http://example.com/v1/user/read"
val stringRequest = StringRequest( Request.Method.GET, url,
Response.Listener<String> { response ->
textView.text = "Response is here"
},
Response.ErrorListener { textView.text = "Error." }
){
override fun getBodyContentType(): String {
return "application/json"
}
override fun getBody(): ByteArray {
return "{\"email\":\"123@foo.de\", \"passwort\":\"123\"}".toString().toByteArray()
}
}