text method
Set request body as plain text.
Sets the body to the provided string and Content-Type to text/plain. Useful for sending raw text, XML, or other non-JSON content.
Example:
testApp.post('/api/notes')
.text('This is a plain text note.');
data Text content for the request body.
Returns this request builder for method chaining.
Implementation
TestRequest text(String data) {
_body = data;
_contentType = 'text/plain';
return this;
}