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 client: OkHttpClient
var isValidKey: Boolean = false
/**
* 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.
*/
fun verifyKey(): Boolean {
val params = HashMap<String, String>()
params["key"] = apiKey
params["blog"] = blog
isValidKey = executeMethod(verifyMethod, FormBody.Builder().build())
return isValidKey
val body = FormBody.Builder().apply {
add("key", apiKey)
add("blog", blog)
}.build()
isVerifiedKey = executeMethod(buildApiUrl(verifyMethod), body)
return isVerifiedKey
}
/**