Adds Content-Type
This commit is contained in:
@@ -6,6 +6,8 @@ Server-sent events (SSE) is a technology where a browser receives automatic upda
|
||||
|
||||
[Real world demostration using Gin](http://sse.getgin.io/)
|
||||
|
||||
##Sample code
|
||||
|
||||
```go
|
||||
import "github.com/manucorporat/sse"
|
||||
|
||||
@@ -38,3 +40,11 @@ data: {"content":"hi!","date":1431540810,"user":"manu"}
|
||||
|
||||
```
|
||||
|
||||
##Content-Type
|
||||
|
||||
```go
|
||||
fmt.Println(sse.ContentType)
|
||||
```
|
||||
```
|
||||
text/event-stream
|
||||
```
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
const ContentType = "text/event-stream"
|
||||
|
||||
// Server-Sent Events
|
||||
// W3C Working Draft 29 October 2009
|
||||
// http://www.w3.org/TR/2009/WD-eventsource-20091029/
|
||||
|
||||
Reference in New Issue
Block a user