Skip to content

Commit e262f36

Browse files
author
Michael Hoisie
committed
Merge branch 'master' of git@github.com:hoisie/web.go
2 parents 848e472 + db0c289 commit e262f36

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

web.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,18 @@ func SetStaticDir(dir string) os.Error {
366366
return nil
367367
}
368368

369+
func Urlencode ( data map[string]string ) string {
370+
var buf bytes.Buffer;
371+
for k,v := range ( data ) {
372+
buf.WriteString ( http.URLEscape(k) )
373+
buf.WriteByte('=' )
374+
buf.WriteString ( http.URLEscape(v) )
375+
buf.WriteByte('&' )
376+
}
377+
s := buf.String()
378+
return s[0:len(s) - 1]
379+
}
380+
369381
//copied from go's http package, because it's not public
370382
var statusText = map[int]string{
371383
http.StatusContinue: "Continue",

0 commit comments

Comments
 (0)