# YAML Response Example

> Example of using g.res.contentType = YAML to respond in YAML format within API Maker.

Source: https://docs.apimaker.dev/v1/examples/res/contentType/YAML.html

### YAML

**Content type YAML**

```typescript
g.res.contentType = T.EContentType.YAML;
return "Hello world from the API Maker.";
```

Response
```yaml
success: true
statusCode: 200
data: Hello world from the API Maker.
```

## Related

- [The global object g](https://docs.apimaker.dev/v1/docs/pre-defined-terms/global-object-g.html) · [Custom APIs](https://docs.apimaker.dev/v1/docs/apis-all/custom-apis/user-created-custom-api.html)
