~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/resource/api/http.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        ContentTypeJSON = "application/json"
35
35
)
36
36
 
 
37
const (
 
38
        // HeaderContentType is the header name for the type of a file upload.
 
39
        HeaderContentType = "Content-Type"
 
40
        // HeaderContentSha384 is the header name for the sha hash of a file upload.
 
41
        HeaderContentSha384 = "Content-Sha384"
 
42
        // HeaderContentLength is the header name for the length of a file upload.
 
43
        HeaderContentLength = "Content-Length"
 
44
        // HeaderContentDisposition is the header name for value that holds the filename.
 
45
        // The params are formatted according to  RFC 2045 and RFC 2616 (see
 
46
        // mime.ParseMediaType and mime.FormatMediaType).
 
47
        HeaderContentDisposition = "Content-Disposition"
 
48
)
 
49
 
 
50
const (
 
51
        // MediaTypeFormData is the media type for file uploads (see
 
52
        // mime.FormatMediaType).
 
53
        MediaTypeFormData = "form-data"
 
54
        // QueryParamPendingID is the query parameter we use to send up the pending id.
 
55
        QueryParamPendingID = "pendingid"
 
56
)
 
57
 
 
58
const (
 
59
        // TODO(natefinch): remove this and use http.MethodPut when we upgrade to go1.5+.
 
60
 
 
61
        // MethodPut is the common HTTP PUT method.
 
62
        MethodPut = "PUT"
 
63
)
 
64
 
37
65
// NewEndpointPath returns the API URL path for the identified resource.
38
66
func NewEndpointPath(service, name string) string {
39
67
        return fmt.Sprintf(HTTPEndpointPath, service, name)