mirror of
https://github.com/kataras/iris.git
synced 2025-03-13 21:36:28 +01:00
This commit is contained in:
parent
7ea334812f
commit
741ecbf2fb
|
@ -2,6 +2,10 @@
|
|||
|
||||
**How to upgrade**: remove your `$GOPATH/src/github.com/kataras/iris` folder, open your command-line and execute this command: `go get -u github.com/kataras/iris`.
|
||||
|
||||
## 4.2.2 -> 4.2.3
|
||||
|
||||
- [Add IsAjax() convenience method](https://github.com/kataras/iris/issues/423)
|
||||
|
||||
## 4.2.1 -> 4.2.2
|
||||
|
||||
- Fix [sessiondb issue 416](https://github.com/kataras/iris/issues/416)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/kataras/iris/releases"><img src="https://img.shields.io/badge/%20version%20-%204.2.2%20-blue.svg?style=flat-square" alt="Releases"></a>
|
||||
<a href="https://github.com/kataras/iris/releases"><img src="https://img.shields.io/badge/%20version%20-%204.2.3%20-blue.svg?style=flat-square" alt="Releases"></a>
|
||||
|
||||
<a href="https://github.com/iris-contrib/examples"><img src="https://img.shields.io/badge/%20examples-repository-3362c2.svg?style=flat-square" alt="Examples"></a>
|
||||
|
||||
|
@ -178,7 +178,7 @@ I recommend writing your API tests using this new library, [httpexpect](https://
|
|||
Versioning
|
||||
------------
|
||||
|
||||
Current: **v4.2.2**
|
||||
Current: **v4.2.3**
|
||||
|
||||
> Iris is an active project
|
||||
|
||||
|
@ -221,7 +221,7 @@ License can be found [here](LICENSE).
|
|||
[Travis]: http://travis-ci.org/kataras/iris
|
||||
[License Widget]: https://img.shields.io/badge/license-MIT%20%20License%20-E91E63.svg?style=flat-square
|
||||
[License]: https://github.com/kataras/iris/blob/master/LICENSE
|
||||
[Release Widget]: https://img.shields.io/badge/release-v4.2.2-blue.svg?style=flat-square
|
||||
[Release Widget]: https://img.shields.io/badge/release-v4.2.3-blue.svg?style=flat-square
|
||||
[Release]: https://github.com/kataras/iris/releases
|
||||
[Chat Widget]: https://img.shields.io/badge/community-chat-00BCD4.svg?style=flat-square
|
||||
[Chat]: https://kataras.rocket.chat/channel/iris
|
||||
|
|
|
@ -277,6 +277,13 @@ func (ctx *Context) RequestHeader(k string) string {
|
|||
return utils.BytesToString(ctx.RequestCtx.Request.Header.Peek(k))
|
||||
}
|
||||
|
||||
// IsAjax returns true if this request is an 'ajax request'( XMLHttpRequest)
|
||||
//
|
||||
// Read more at: http://www.w3schools.com/ajax/
|
||||
func IsAjax() bool {
|
||||
return (c.RequestHeader("HTTP_X_REQUESTED_WITH") == "XMLHttpRequest")
|
||||
}
|
||||
|
||||
// FormValueString returns a single value, as string, from post request's data
|
||||
func (ctx *Context) FormValueString(name string) string {
|
||||
return string(ctx.FormValue(name))
|
||||
|
|
|
@ -28,6 +28,7 @@ type (
|
|||
RequestIP() string
|
||||
RemoteAddr() string
|
||||
RequestHeader(k string) string
|
||||
IsAjax() bool
|
||||
FormValueString(string) string
|
||||
FormValues(string) []string
|
||||
PostValuesAll() map[string][]string
|
||||
|
|
Loading…
Reference in New Issue
Block a user