Skip to content

Commit ba4a010

Browse files
committed
Updated docs
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent 5f01299 commit ba4a010

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

website/content/guide/response.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ Context.JSON(code int, v interface{}) error
6666

6767
Sends a JSON HTTP response with status code.
6868

69+
### JSONP
70+
71+
```go
72+
Context.JSONP(code int, callback string, i interface{}) error
73+
```
74+
75+
Sends a JSONP HTTP response with status code. It uses `callback` to construct the
76+
JSONP payload.
77+
6978
### XML
7079

7180
```go
@@ -93,11 +102,12 @@ Sends a text/plain HTTP response with status code.
93102
### File
94103

95104
```go
96-
Context.File(name string, attachment bool) error
105+
Context.File(name, path string, attachment bool) error
97106
```
98107

99-
File sends a response with the content of the file. If attachment is `true`, the client
100-
is prompted to save the file.
108+
File sends a response with the content of the file. If `attachment` is set
109+
to `true`, the client is prompted to save the file with provided `name`,
110+
name can be empty, in that case name of the file is used.
101111

102112
### Static files
103113

website/content/guide/routing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ e.Get("/hello", func(c *echo.Context) error {
2121
})
2222
```
2323

24+
You can use `Echo.Any(path string, h Handler)` to register a handler for all HTTP methods.
25+
To register it for some methods, use `Echo.Match(methods []string, path string, h Handler)`.
26+
27+
2428
Echo's default handler is `func(*echo.Context) error` where `echo.Context` primarily
2529
holds HTTP request and response objects. Echo also has a support for other types
2630
of handlers.

0 commit comments

Comments
 (0)