Skip to content

Commit

Permalink
feat: add custom response documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Dec 5, 2024
1 parent 0ff05cf commit 7e50db4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/docs/http/response.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ $app->response()->xml('<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

### Custom responses

If you need to create a custom response, which is not covered by the methods above, you can use the `custom()` method. This method accepts 2 parameters:
If you need to create a custom response, which is not covered by the methods above, you can use the `echo()` method. This method accepts 2 parameters:

- the content to output
- an optional status code (defaults to 200/OK)
Expand All @@ -274,7 +274,7 @@ response()
'Content-Length' => $dataLength,
'Content-Disposition' => "inline; filename=\"$filename\""
])
->custom($rawData);
->echo($rawData);
```

```php:no-line-numbers [Leaf Instance]
Expand All @@ -285,7 +285,7 @@ $app
'Content-Length' => $dataLength,
'Content-Disposition' => "inline; filename=\"$filename\""
])
->custom($rawData);
->echo($rawData);
```

:::
Expand Down

0 comments on commit 7e50db4

Please sign in to comment.