package it.danieleverducci.openweddingapp.networking

import com.android.volley.Response
import com.android.volley.toolbox.JsonObjectRequest
import org.json.JSONObject

class AuthenticatedJsonObjectRequest(
    val token: String,
    method: Int,
    url: String?,
    jsonRequest: JSONObject?,
    listener: Response.Listener<JSONObject>?,
    errorListener: Response.ErrorListener?
) : JsonObjectRequest(method, url, jsonRequest, listener, errorListener) {

    override fun getHeaders(): MutableMap<String, String> {
        val h = HashMap<String, String>()
        h.put("Authentication", token)
        h.put("Accept", "application/json")
        return h
    }
}