//Post meets the interface RestPost but calls the wrapped QBSRestPost
546258
func (self *qbsWrapped) Post(value interface{}, pb PBundle) (interface{}, error) {
	return self.applyPolicy(pb, func(tx *qbs.Qbs) (interface{}, error) {
		return self.post.PostQbs(value, pb, tx)
	})
}
860365
func Post(url string, opts Options) error {
	r, err := Request("POST", url, opts)
	if opts.Response != nil {
		*opts.Response = r
	}
	return err
}
137644
func (c *Client) Post(url string, bodyType string, body interface{}) (*Response, error) {
	req, err := c.NewRequest("POST", url, body)
	if err != nil {
		return nil, err
	}

	req.Header.Set("Content-Type", bodyType)

	req = c.Config.AddRequestHeader(req)
	response, err := c.Do(req)

	if err != nil {
		return nil, err
	}

	return response, nil
}
1317621
func (l *Client) Post(endpoint string, params url.Values, body interface{}, response, data interface{}) error {
	return l.PostType("application/json", endpoint, params, body, response, data)
}
225787
func Post(endpoint string, req *PostRequest, apiKey string, silent bool, debug bool) error {
	if silent {
		enc, _ := json.MarshalIndent(req, "", "\t")
		fmt.Println(string(enc))
		return nil
	}
	httpClient := &http.Client{}
	json, err := json.Marshal(req)
	if err != nil {
		errMsg := fmt.Sprintf("Unable to convert to JSON (%s): %#v", err.Error(), req)
		return errors.New(errMsg)
	}

	r, err := http.NewRequest("POST", endpoint+"/entries", bytes.NewBuffer(json))
	if err != nil {
		errMsg := fmt.Sprintf("Unable to create request (%s)", err.Error())
		return errors.New(errMsg)
	}
	r.Header.Add(apiKeyHeader, apiKey)
	resp, err := httpClient.Do(r)
	if err != nil {
		return err
	}

	defer func() {
		if resp != nil && resp.Body != nil {
			resp.Body.Close()
		}
	}()

	if resp.StatusCode >= 400 {
		return fmt.Errorf("Failed to send message to Raygun with status:%d", resp.StatusCode)
	}
	return nil
}
1369726
func (r *Router) POST(route string, handler interface{}) *Router {
	r.Handle(MethodPOST, route, handler)
	return r
}
1057575
func (g *routeGroup) Post(path string, h http.HandlerFunc) {
	g.handle(http.MethodPost, path, h)
}
158155
func QbsWrapAll(a QbsRestAll, s *QbsStore) RestAll {
	return &qbsWrapped{store: s, index: a, find: a, del: a, put: a, post: a}
}
32751
func (sc *Client) Post(ctx context.Context, message whisper.NewMessage) (string, error) {
	var hash string
	return hash, sc.c.CallContext(ctx, &hash, "shh_post", message)
}
186005
func (f *Fibre) Post(p string, h HandlerFunc) {
	f.router.Add(POST, p, h)
}
791028
func (c *Client) Post(URI string, data interface{}, decoded interface{}) (*http.Response, error) {
	if debug {
		fmt.Printf("DEBUG: POST URI=%s\n", URI)
	}
	req, err := c.NewJSONRequest("POST", URI, data)
	if err != nil {
		return nil, err
	}
	if debug {
		fmt.Printf("DEBUG: POST req=%v decoded=%v\n", req, decoded)
	}
	resp, err := c.DoRest(req, decoded)
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != http.StatusCreated {
		return nil, fmt.Errorf("Unexpected http code %d on URL %v. expecting %d", resp.StatusCode, resp.Request.URL, http.StatusCreated)
	}
	return resp, err
}
822567
func (this *Server) Post(path string, fn ...func(*Request, *Response, func())) {
	this.Verb("post", path, fn...)
}
110504
func HTTPPost(url string, req interface{}, resp interface{}) error {
	// Convert the req to json
	jsonStr, err := json.Marshal(req)
	if err != nil {
		log.Errorf("Error converting request data(%#v) to Json. Err: %v", req, err)
		return err
	}

	// Perform HTTP POST operation
	res, err := http.Post(url, "application/json", strings.NewReader(string(jsonStr)))
	if err != nil {
		log.Errorf("Error during http POST. Err: %v", err)
		return err
	}

	defer res.Body.Close()

	// Check the response code
	if res.StatusCode == http.StatusInternalServerError {
		eBody, err := ioutil.ReadAll(res.Body)
		if err != nil {
			return errors.New("HTTP StatusInternalServerError" + err.Error())
		}
		return errors.New(string(eBody))
	}

	if res.StatusCode != http.StatusOK {
		log.Errorf("HTTP error response. Status: %s, StatusCode: %d", res.Status, res.StatusCode)
		return fmt.Errorf("HTTP error response. Status: %s, StatusCode: %d", res.Status, res.StatusCode)
	}

	// Read the entire response
	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		log.Errorf("Error during ioutil readall. Err: %v", err)
		return err
	}

	// Convert response json to struct
	err = json.Unmarshal(body, resp)
	if err != nil {
		log.Errorf("Error during json unmarshall. Err: %v", err)
		return err
	}

	log.Debugf("Results for (%s): %+v\n", url, resp)

	return nil
}
516021
func (api *PublicWhisperAPI) Post(ctx context.Context, req NewMessage) (hexutil.Bytes, error) {
	var (
		symKeyGiven = len(req.SymKeyID) > 0
		pubKeyGiven = len(req.PublicKey) > 0
		err         error
	)

	// user must specify either a symmetric or an asymmetric key
	if (symKeyGiven && pubKeyGiven) || (!symKeyGiven && !pubKeyGiven) {
		return nil, ErrSymAsym
	}

	params := &MessageParams{
		TTL:      req.TTL,
		Payload:  req.Payload,
		Padding:  req.Padding,
		WorkTime: req.PowTime,
		PoW:      req.PowTarget,
		Topic:    req.Topic,
	}

	// Set key that is used to sign the message
	if len(req.Sig) > 0 {
		if params.Src, err = api.w.GetPrivateKey(req.Sig); err != nil {
			return nil, err
		}
	}

	// Set symmetric key that is used to encrypt the message
	if symKeyGiven {
		if params.Topic == (TopicType{}) { // topics are mandatory with symmetric encryption
			return nil, ErrNoTopics
		}
		if params.KeySym, err = api.w.GetSymKey(req.SymKeyID); err != nil {
			return nil, err
		}
		if !validateDataIntegrity(params.KeySym, aesKeyLength) {
			return nil, ErrInvalidSymmetricKey
		}
	}

	// Set asymmetric key that is used to encrypt the message
	if pubKeyGiven {
		if params.Dst, err = crypto.UnmarshalPubkey(req.PublicKey); err != nil {
			return nil, ErrInvalidPublicKey
		}
	}

	// encrypt and sent message
	whisperMsg, err := NewSentMessage(params)
	if err != nil {
		return nil, err
	}

	var result []byte
	env, err := whisperMsg.Wrap(params)
	if err != nil {
		return nil, err
	}

	// send to specific node (skip PoW check)
	if len(req.TargetPeer) > 0 {
		n, err := enode.ParseV4(req.TargetPeer)
		if err != nil {
			return nil, fmt.Errorf("failed to parse target peer: %s", err)
		}
		err = api.w.SendP2PMessage(n.ID().Bytes(), env)
		if err == nil {
			hash := env.Hash()
			result = hash[:]
		}
		return result, err
	}

	// ensure that the message PoW meets the node's minimum accepted PoW
	if req.PowTarget < api.w.MinPow() {
		return nil, ErrTooLowPoW
	}

	err = api.w.Send(env)
	if err == nil {
		hash := env.Hash()
		result = hash[:]
	}
	return result, err
}
1355588
func (api UsersAPI) Post(w http.ResponseWriter, r *http.Request) {

	var u user.User

	if err := json.NewDecoder(r.Body).Decode(&u); err != nil {
		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
		return
	}

	userMgr := user.NewManager(r)
	if err := userMgr.Save(&u); err != nil {
		log.Error("ERROR while saving user:\n", err)
		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
		return
	}

	w.Header().Set("Content-Type", "application/json")
	w.WriteHeader(http.StatusCreated)

	json.NewEncoder(w).Encode(&u)
}
182352
func (d *Doer) Post(url string, body io.Reader, bodyType string, response interface{}) (*http.Response, error) {
	req, err := d.newRequest(http.MethodPost, url, body, contentType(bodyType))
	if err != nil {
		return nil, err
	}

	return d.do(req, response)
}
1292086
func (rc *RequestConfig) POST(path string) *RequestConfig {
	rc.Path = path
	rc.Method = "POST"

	return rc
}