Added httpStatusCode.
This commit is contained in:
parent
b255f66734
commit
c7eb6518ac
1 changed files with 6 additions and 0 deletions
|
@ -92,19 +92,24 @@ open class Akismet(apiKey: String, blog: String) {
|
|||
/**
|
||||
* The HTTP status code of the last operation.
|
||||
*/
|
||||
@Suppress("MemberVisibilityCanBePrivate")
|
||||
var httpStatusCode: Int = 0
|
||||
private set
|
||||
|
||||
/**
|
||||
* The X-akismet-pro-tip header from the last operation, if any.
|
||||
*/
|
||||
@Suppress("MemberVisibilityCanBePrivate")
|
||||
var proTip: String = ""
|
||||
private set
|
||||
|
||||
/**
|
||||
* The X-akismet-error header from the last operation, if any.
|
||||
*/
|
||||
@Suppress("MemberVisibilityCanBePrivate")
|
||||
var error: String = ""
|
||||
private set
|
||||
|
||||
/**
|
||||
* The X-akismet-debug-help header from the last operation, if any.
|
||||
*/
|
||||
|
@ -431,6 +436,7 @@ open class Akismet(apiKey: String, blog: String) {
|
|||
val request = Request.Builder().url(apiUrl).post(formBody).header("User-Agent", libUserAgent).build()
|
||||
try {
|
||||
val result = client.newCall(request).execute()
|
||||
httpStatusCode = result.code
|
||||
proTip = result.header("x-akismet-pro-tip", "").toString()
|
||||
error = result.header("x-akismet-error", "").toString()
|
||||
degugHelp = result.header("X-akismet-debug-help", "").toString()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue