github.com/openshift-online/ocm-sdk-go@v0.1.473/methods.go (about) 1 /* 2 Copyright (c) 2019 Red Hat, Inc. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // This file contains the implementation of the methods. 18 19 package sdk 20 21 import ( 22 "net/http" 23 ) 24 25 // Get creates an HTTP GET request. Note that this request won't be sent till the Send method is 26 // called. 27 func (c *Connection) Get() *Request { 28 request := new(Request) 29 request.transport = c 30 request.method = http.MethodGet 31 return request 32 } 33 34 // Post creates an HTTP POST request. Note that this request won't be sent till the Send method is 35 // called. 36 func (c *Connection) Post() *Request { 37 request := new(Request) 38 request.transport = c 39 request.method = http.MethodPost 40 return request 41 } 42 43 // Patch creates an HTTP PATCH request. Note that this request won't be sent till the Send method is 44 // called. 45 func (c *Connection) Patch() *Request { 46 request := new(Request) 47 request.transport = c 48 request.method = http.MethodPatch 49 return request 50 } 51 52 // Put creates an HTTP PUT request. Note that this request won't be sent till the Send method is 53 // called. 54 func (c *Connection) Put() *Request { 55 request := new(Request) 56 request.transport = c 57 request.method = http.MethodPut 58 return request 59 } 60 61 // Delete creates an HTTP DELETE request. Note that this request won't be sent till the Send method 62 // is called. 63 func (c *Connection) Delete() *Request { 64 request := new(Request) 65 request.transport = c 66 request.method = http.MethodDelete 67 return request 68 }