You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
899 B

package com.example.http
import com.example.action.HttpMethod
import com.example.action.NoString
data class Request(
var url:String,
var method: HttpMethod = HttpMethod.Get,
var headers:Map<String, String> = emptyMap(),
var body: ByteArray = byteArrayOf()
): NoString() {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is Request) return false
if (url != other.url) return false
if (method != other.method) return false
if (headers != other.headers) return false
if (!body.contentEquals(other.body)) return false
return true
}
override fun hashCode(): Int {
var result = url.hashCode()
result = 31 * result + method.hashCode()
result = 31 * result + headers.hashCode()
result = 31 * result + body.hashCode()
return result
}
}