From 3ab3d151c74ff0c491a43c4f198a5c8b522f9cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Werner?= Date: Wed, 15 Nov 2023 09:23:08 +0100 Subject: [PATCH] =?UTF-8?q?refresh=20docs=20for=20=F0=9F=94=A5=20Add=20sup?= =?UTF-8?q?port=20for=20application/problem+json=20#2704?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/client.md | 4 ++-- docs/api/ctx.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api/client.md b/docs/api/client.md index 7ec9f3b033..ffbe308f94 100644 --- a/docs/api/client.md +++ b/docs/api/client.md @@ -268,10 +268,10 @@ agent.BodyStream(strings.NewReader("body=stream"), -1) ### JSON -JSON sends a JSON request by setting the Content-Type header to `application/json`. +JSON sends a JSON request by setting the Content-Type header to the `ctype` parameter. If no `ctype` is passed in, the header is set to `application/json`. ```go title="Signature" -func (a *Agent) JSON(v interface{}) *Agent +func (a *Agent) JSON(v interface{}, ctype ...string) *Agent ``` ```go title="Example" diff --git a/docs/api/ctx.md b/docs/api/ctx.md index 7b195683db..2c3244926f 100644 --- a/docs/api/ctx.md +++ b/docs/api/ctx.md @@ -797,7 +797,7 @@ app.Get("/", func(c *fiber.Ctx) error { Converts any **interface** or **string** to JSON using the [encoding/json](https://pkg.go.dev/encoding/json) package. :::info -JSON also sets the content header to the `ctype` parameter. If no `ctype` is passed in, the header is set to **application/json**. +JSON also sets the content header to the `ctype` parameter. If no `ctype` is passed in, the header is set to `application/json`. ::: ```go title="Signature"