Changed isValidKey to isVerifiedKey.

This commit is contained in:
Erik C. Thauvin 2019-09-19 12:27:44 -07:00
parent 4b018f926a
commit aa43c1a11a

View file

@ -86,7 +86,6 @@ open class Akismet(apiKey: String, blog: String) {
private var blog: String private var blog: String
private var client: OkHttpClient private var client: OkHttpClient
var isValidKey: Boolean = false
/** /**
* Check if the API Key has been verified. * Check if the API Key has been verified.
*/ */
@ -151,11 +150,12 @@ open class Akismet(apiKey: String, blog: String) {
* See the [Akismet API](https://akismet.com/development/api/#verify-key) for more details. * See the [Akismet API](https://akismet.com/development/api/#verify-key) for more details.
*/ */
fun verifyKey(): Boolean { fun verifyKey(): Boolean {
val params = HashMap<String, String>() val body = FormBody.Builder().apply {
params["key"] = apiKey add("key", apiKey)
params["blog"] = blog add("blog", blog)
isValidKey = executeMethod(verifyMethod, FormBody.Builder().build()) }.build()
return isValidKey isVerifiedKey = executeMethod(buildApiUrl(verifyMethod), body)
return isVerifiedKey
} }
/** /**