github.com/MontFerret/ferret@v0.18.0/pkg/stdlib/io/net/http/lib.go (about)

     1  package http
     2  
     3  import "github.com/MontFerret/ferret/pkg/runtime/core"
     4  
     5  // RegisterLib register `HTTP` namespace functions.
     6  // @namespace HTTP
     7  func RegisterLib(ns core.Namespace) error {
     8  	return ns.
     9  		Namespace("HTTP").
    10  		RegisterFunctions(
    11  			core.NewFunctionsFromMap(map[string]core.Function{
    12  				"GET":    GET,
    13  				"POST":   POST,
    14  				"PUT":    PUT,
    15  				"DELETE": DELETE,
    16  				"DO":     REQUEST,
    17  			}))
    18  }