---
description: >-
  A basic response function for sending basic html/text content back to the
  caller
---

# send

{% hint style="info" %}
The `send` method is a curried method meaning it doesn't need to be provided all parameters at once
{% endhint %}

```javascript
const { response } = require('octoris')

```

## Arguments

| Name | Type   | Description                            |
| ---- | ------ | -------------------------------------- |
| code | Number | The status code for the response       |
| data | Any    | The data to send back to the requester |

{% hint style="warning" %}
&#x20;You must supply both arguments at some point within your handler or the function will throw an error on request
{% endhint %}

## Usage

{% hint style="info" %}
You would use the response functions within your method handlers you can read about the methods [here](https://octoris.dusty.codes/methods-api/get)
{% endhint %}

```javascript
const { response } = require('octoris')
// Since responses are curried we can create a basic status code constant
const OK = response.send(200)

function homeHandler (ctx) {
  return OK('Hello Home!')
}

function aboutHandler (ctx) {
  return response.send(201, 'New Status with about!')
}

```
