Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xmlhttprequest

This is a library to simulate xmlhttprequest javascript´s object on golang. To import it put in your OS console. ->go get github.com/dogia/xmlhttprequest

How to use:

package main

import xhr "github.com/dogia/xmlhttprequest"

func main(){

	xhr := xhr.New()

	xhr.EventListener("readystatechange", func() {
		fmt.Println("Ready state: " + strconv.Itoa(int(xhr.ReadyState())))
	})
	xhr.Open("POST", "http://localhost", false, "", "")
	xhr.Send("data=abcde")

	fmt.Println(xhr.ResponseText)

Functions

xhr.EventListener(event #string, mananger #func())

xhr.SetHeader(Name, Value #string)

xhr.Abort()

xhr.ReadyState() //returns uint8 readyState

About

library to simulate xmlhttprequest object of javascript in golang

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages