# Data for the body of a POST request
var data: nullable HeaderMap is writable
+ # Raw body string
+ #
+ # Set this value to send raw data instead of the POST formatted `data`.
+ #
+ # If `data` is set, the body will not be sent.
+ var body: nullable String is writable
+
# Header content of the request
var headers: nullable HeaderMap is writable
var postdatas = data.to_url_encoded(self.curl)
err = self.curl.native.easy_setopt(new CURLOption.postfields, postdatas)
if not err.is_ok then return answer_failure(err.to_i, err.to_s)
+ else if body != null then
+ err = self.curl.native.easy_setopt(new CURLOption.postfields, body.as(not null))
+ if not err.is_ok then return answer_failure(err.to_i, err.to_s)
end
var err_resp = perform
# Protocols supported to send mail to a server
#
# Default value at `["smtp", "smtps"]`
- var supported_outgoing_protocol: Array[String] = ["smtp", "smtps"]
+ var supported_outgoing_protocol = ["smtp", "smtps"]
# Helper method to add pair values to mail content while building it (ex: "To:", "address@mail.com")
private fun add_pair_to_content(str: String, att: String, val: nullable String): String