# AkismetComment

open class AkismetComment (val userIp: String , val userAgent: String )(source)

A comment to send to Akismet.

Most everything is optional. Performance can drop dramatically if you choose to exclude data points. The more data you send Akismet about each comment, the greater the accuracy. They recommend erring on the side of including too much data.

See the Akismet API for more details.

#### Parameters

userIp

IP address of the comment submitter.

userAgent

User agent string of the web browser submitting the comment.

## Constructors

AkismetComment
Link copied to clipboard
constructor(request: <Error class: unknown class>)

Creates a new instance extracting the userIp, userAgent, referrer and serverEnv environment variables from a Servlet request.

constructor(userIp: String , userAgent: String )

Creates a new instance.

## Types

Companion
Link copied to clipboard
object Companion

## Properties

author
Link copied to clipboard
var author : String ?

Name submitted with the comment.

authorEmail
Link copied to clipboard
var authorEmail : String ?

Email address submitted with the comment.

authorUrl
Link copied to clipboard
var authorUrl : String ?

URL submitted with comment.

blogCharset
Link copied to clipboard
var blogCharset : String ?

The character encoding for the form values included in comment parameters, such as UTF-8 or ISO-8859-1

blogLang
Link copied to clipboard
var blogLang : String ?

Indicates the language(s) in use on the blog or site, in ISO 639-1 format, comma-separated.

content
Link copied to clipboard
var content : String ?

The content that was submitted.

dateGmt
Link copied to clipboard
var dateGmt : String ?

The UTC timestamp of the creation of the comment, in ISO 8601 format.

isTest
Link copied to clipboard
var isTest : Boolean

This is an optional parameter. You can use it when submitting test queries to Akismet.

permalink
Link copied to clipboard
var permalink : String ?

The full permanent URL of the entry the comment was submitted to.

postModifiedGmt
Link copied to clipboard
var postModifiedGmt : String ?

The UTC timestamp of the publication time for the post, page or thread on which the comment was posted.

recheckReason
Link copied to clipboard
var recheckReason : String ?

If you are sending content to Akismet to be rechecked, such as a post that has been edited or old pending comments that you'd like to recheck, include this parameter with a string describing why the content is being rechecked.

referrer
Link copied to clipboard
var referrer : String ?

The content of the referer header should be set here.

serverEnv
Link copied to clipboard
var serverEnv : Map < String , String >

In PHP, there is an array of environmental variables called `$_SERVER` that contains information about the Web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet.

type
Link copied to clipboard
var type : String ?

A string that describes the type of content being sent, such as:

userAgent
Link copied to clipboard
val userAgent : String
userIp
Link copied to clipboard
val userIp : String
userRole
Link copied to clipboard
var userRole : String ?

The user role of the user who submitted the comment. This is an optional parameter.

## Functions

equals
Link copied to clipboard
open operator override fun equals (other: Any ?): Boolean

Indicates whether some other object is equal to this one.

hashCode
Link copied to clipboard
open override fun hashCode (): Int

Returns a hash code value for the object.

toJson
Link copied to clipboard
fun toJson (): String

Returns a JSON representation of the comment.

toString
Link copied to clipboard
open override fun toString (): String

Returns a JSON representation of the comment.