// Post is a short hand of Api(path, POST, params).
328313
func Post(path string, params Params) (Result, error) {
	return Api(path, POST, params)
}
279785
func Post() echo.HandlerFunc {

	// swagger:route GET /me/posts/{pid} me post GetMePost
	//
	// Shows selected posts with id pid on specified user board
	//
	// This will show the last comments on the post by default.
	// You can personalize the request via query string parameters
	//
	//	Produces:
	//	- application/json
	//
	//	Security:
	//		oauth: profile_messages:read
	//
	//	Responses:
	//		default: MePostsPid

	return func(c echo.Context) error {
		return user.Post()(c)
	}
}
130714
func (api *APIBuilder) Post(relativePath string, handlers ...context.Handler) *Route {
	return api.Handle(http.MethodPost, relativePath, handlers...)
}
1358410
func (s *Sling) Post(pathURL string) *Sling {
	s.method = "POST"
	return s.Path(pathURL)
}
967939
func (e *Expect) POST(path string, pathargs ...interface{}) *Request {
	return e.Request("POST", path, pathargs...)
}
1044433
func (c *Client) Post() *Request {
	req := c.Request()
	req.Method("POST")
	return req
}
1026259
func (c *HTTPClient) Post(url string, bodyType string, body io.Reader) (*http.Response, error) {
	var resp *http.Response
	breaker := c.breakerLookup(url)
	err := breaker.Call(func() error {
		aresp, err := c.Client.Post(url, bodyType, body)
		resp = aresp
		return err
	}, c.timeout)
	return resp, err
}
941828
func post(body map[string]interface{}) error {
	if len(Token) == 0 {
		stderr("empty token")
		return nil
	}

	jsonBody, err := json.Marshal(body)
	if err != nil {
		stderr("failed to encode payload: %s", err.Error())
		return err
	}

	resp, err := http.Post(Endpoint, "application/json", bytes.NewReader(jsonBody))
	if err != nil {
		stderr("POST failed: %s", err.Error())
		return err
	}
	defer resp.Body.Close()

	if resp.StatusCode != 200 {
		stderr("received response: %s", resp.Status)
		return ErrHTTPError(resp.StatusCode)
	}

	return nil
}
715128
func (r *Router) Post(pattern string, handlers ...Middleware) *Router {
	return r.Handle(http.MethodPost, pattern, handlers...)
}
26441
func Post(url, bodyType string, body interface{}) (*http.Response, error) {
	return defaultClient.Post(url, bodyType, body)
}
1019115
func (r *Router) Post(path string, fn interface{}) *Router {
	return r.addRoute(httpMethodPost, path, fn)
}
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
}
216366
func (r *Request) Post(url string) (*Response, error) {
	return r.Execute(MethodPost, url)
}
1347865
func (c *Client) Post(fmr *FullRequest, resp interface{}, options ...RequestOptions) (err error) {
	url := buildURL(c.apiBase, fmr.Info)
	req, err := createRequest("POST", url, fmr.Payload, nil, options...)
	if err != nil {
		return err
	}

	headers := map[string]string{"Content-Type": "application/json"}
	c.Lock()
	defer c.Unlock()
	_, _, err = c.httpClient.Send(req).With(headers).Read(resp).Call()
	return err
}
417956
func (a *Core) post(uri string, reqBody, response interface{}) (*http.Response, error) {
	content, err := json.Marshal(reqBody)
	if err != nil {
		return nil, errors.New("failed to marshal message")
	}

	return a.retrievablePost(uri, content, response)
}
1350490
func (r Resource) Post(request *restful.Request, response *restful.Response) {
	if resource, ok := r.Parent.(PostSupported); ok {
		context := r.Context.NewAPIContext()
		if resource.PostAuthRequired() {
			auth, err := context.Authentication(request)
			if err != nil || auth == nil {
				ErrorResponseHandler(request, response, err, NewErrorResponse(
					http.StatusUnauthorized,
					"Invalid accesstoken",
					"POST"))
				return
			}
		}

		ps := resource.Reads()
		if ps != nil {
			err := request.ReadEntity(&ps)
			if err != nil {
				ErrorResponseHandler(request, response, err, NewErrorResponse(
					http.StatusBadRequest,
					"Can't parse request data",
					"POST Data Validation"))
				return
			}

			err = resource.Validate(context, ps, request)
			if err != nil {
				ErrorResponseHandler(request, response, err, NewErrorResponse(
					http.StatusBadRequest,
					err,
					"POST Data Validation"))
				return
			}
		}

		resource.Post(context, ps, request, response)
		request.SetAttribute("context", context)
	}
}
1279138
func (r *Router) Post(path string, handler HandlerFunc) {
	r.Add(POST, path, handler)
}