// NewPost handles the request and creates a new post
544703
func NewPost() echo.HandlerFunc {

	// swagger:route POST /me/posts me post NewMePost
	//
	// Creates a new post on the specified user board
	//
	// Consumes:
	// - application/json
	//
	//	Produces:
	//	- application/json
	//
	//	Security:
	//		oauth: profile_messages:write
	//
	//	Responses:
	//		default: MePostsPid

	return func(c echo.Context) error {
		return user.NewPost()(c)
	}
}
844518
func NewRequest() *Request {
	return &Request{
		Counter:    1,
		URLStruct:  &url.URL{},
		Header:     make(http.Header),
		PathParams: make(map[string]string),
	}
}
26441
func Post(url, bodyType string, body interface{}) (*http.Response, error) {
	return defaultClient.Post(url, bodyType, body)
}
1368423
func (r *Route) Post(handler http.Handler) *Route {
	r.handlers[http.MethodPost] = handler
	return r
}
132813
func (srv *Server) NewRequest(method, path string) *Request {
	req := NewRequest(srv.assertion, srv.client, method, path)
	req.prefix = srv.server.URL

	return req
}
148195
func (gr *GoReq) Post(targetURL string) *GoReq {
	//gr.Reset()
	gr.Method = POST
	gr.URL = targetURL
	gr.Errors = nil
	return gr
}
212155
func (forceApi *ForceApi) Post(path string, params url.Values, payload, out interface{}) error {
	return forceApi.request("POST", path, params, payload, out)
}
557169
func (c Client) New(params *stripe.OrderParams) (*stripe.Order, error) {
	p := &stripe.Order{}
	err := c.B.Call(http.MethodPost, "/v1/orders", c.Key, params, p)
	return p, err
}
94655
func newHTTPRequest(path string, data io.Reader) (*http.Request, error) {
	if !strings.HasPrefix(path, "/") {
		path = "/" + path
	}
	req, err := http.NewRequest("POST", path, data)
	if err != nil {
		return nil, err
	}
	req.Header.Add("Accept", VersionMimetype)
	return req, nil
}
1044433
func (c *Client) Post() *Request {
	req := c.Request()
	req.Method("POST")
	return req
}
1367432
func NewProjectPost(hpid uint64) (*ProjectPost, error) {
	return NewProjectPostWhere(&ProjectPost{Post{Hpid: hpid}})
}
958654
func Post(baseURL string, object *jsh.Object) (*jsh.Document, *http.Response, error) {
	request, err := PostRequest(baseURL, object)
	if err != nil {
		return nil, nil, err
	}

	return Do(request, jsh.ObjectMode)
}
1303201
func NewRequest(method, path string) (*http.Request, error) {
	req, err := http.NewRequest(method, path, nil)

	return req, err
}
1176878
func NewRequest(method, url string, m *dns.Msg) (*http.Request, error) {
	buf, err := m.Pack()
	if err != nil {
		return nil, err
	}

	switch method {
	case http.MethodGet:
		b64 := base64.RawURLEncoding.EncodeToString(buf)

		req, err := http.NewRequest(http.MethodGet, "https://"+url+Path+"?dns="+b64, nil)
		if err != nil {
			return req, err
		}

		req.Header.Set("content-type", MimeType)
		req.Header.Set("accept", MimeType)
		return req, nil

	case http.MethodPost:
		req, err := http.NewRequest(http.MethodPost, "https://"+url+Path+"?bla=foo:443", bytes.NewReader(buf))
		if err != nil {
			return req, err
		}

		req.Header.Set("content-type", MimeType)
		req.Header.Set("accept", MimeType)
		return req, nil

	default:
		return nil, fmt.Errorf("method not allowed: %s", method)
	}

}
1279138
func (r *Router) Post(path string, handler HandlerFunc) {
	r.Add(POST, path, handler)
}
44917
func (c *Client) NewRequest(params map[string]string, method string, action string) (*http.Request, error) {
	p := url.Values{}
	u, err := url.Parse(c.URL)

	if err != nil {
		return nil, fmt.Errorf("Error parsing base URL: %s", err)
	}

	// Build up our request parameters
	for k, v := range params {
		p.Add(k, v)
	}

	// Add authentication details
	p.Add("tkn", c.Token)
	p.Add("email", c.Email)

	// The "action" to take against the API
	p.Add("a", action)

	// Add the params to our URL
	u.RawQuery = p.Encode()

	// Build the request
	req, err := http.NewRequest(method, u.String(), nil)

	if err != nil {
		return nil, fmt.Errorf("Error creating request: %s", err)
	}

	return req, nil

}
586260
func (rt *apiRoundTripper) newRequest(method, prefix, path string,
	query *url.Values, body interface{}) (*http.Request, string, error) {

	requestID := uuid.NewV4().String()

	prefixed := "/" + prefix + path
	req, err := rt.DefaultRequestDoer.NewRequest(method, prefixed, query, body)
	if err != nil {
		return nil, requestID, err
	}

	req.Header.Set("X-Request-ID", requestID)

	return req, requestID, nil
}