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

     1  package http
     2  
     3  import (
     4  	"context"
     5  	h "net/http"
     6  
     7  	"github.com/MontFerret/ferret/pkg/runtime/core"
     8  )
     9  
    10  // POST makes a POST request.
    11  // @param {Object} params - Request parameters.
    12  // @param {String} params.url - Target url
    13  // @param {Any} params.body - Request data
    14  // @param {Object} [params.headers] - HTTP headers
    15  // @return {Binary} - Response in binary format
    16  func POST(ctx context.Context, args ...core.Value) (core.Value, error) {
    17  	return execMethod(ctx, h.MethodPost, args)
    18  }