func DownloadResource(url string, name string, resType string) error {
	var filename string
	if resType == ".zip" {
		filename = name + ".zip"
	} else {
		filename = name
	}
	out, err := os.Create(filename)
	if err != nil {
		clilog.Error.Println("error creating file: ", err)
		return err
	}
	defer out.Close()
	client, err := getHttpClient()
	if err != nil {
		return err
	}
	clilog.Info.Println("Connecting to : ", url)
	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		clilog.Error.Println("error in client: ", err)
		return err
	}
	req, err = setAuthHeader(req)
	if err != nil {
		return err
	}
	resp, err := client.Do(req)
	if err != nil {
		clilog.Error.Println("error connecting: ", err)
		return err
	} else if resp.StatusCode > 299 {
		clilog.Error.Println("error in response: ", resp.Body)
		return errors.New("error in response")
	}
	if resp != nil {
		defer resp.Body.Close()
	}
	if resp == nil {
		clilog.Error.Println("error in response: Response was null")
		return fmt.Errorf("error in response: Response was null")
	}
	_, err = io.Copy(out, resp.Body)
	if err != nil {
		clilog.Error.Println("error writing response to file: ", err)
		return err
	}
	fmt.Println("Resource " + filename + " completed")
	return nil
}
DownloadResource method is used to download resources, proxy bundles, sharedflows
package apiclient
import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"mime/multipart"
	"net/http"
	"net/url"
	"os"
	"github.com/srinandan/apigeecli/clilog"
)
func PostHttpZip(print bool, auth bool, method string, url string, headers map[string]string, zipfile string) (err error) {
	var req *http.Request
	payload, err := ioutil.ReadFile(zipfile)
	if err != nil {
		return err
	}
	client, err := getHttpClient()
	if err != nil {
		return err
	}
	clilog.Info.Println("Connecting to : ", url)
	req, err = http.NewRequest(method, url, bytes.NewBuffer(payload))
	if err != nil {
		clilog.Error.Println("error in client: ", err)
		return err
	}
	for headerName, headerValue := range headers {
		clilog.Info.Printf("%s : %s\n", headerName, headerValue)
		req.Header.Set(headerName, headerValue)
	}
	if auth {  
		req, err = setAuthHeader(req)
		if err != nil {
			return err
		}
	}
	resp, err := client.Do(req)
	if err != nil {
		clilog.Error.Println("error connecting: ", err)
		return err
	}
	if resp != nil {
		defer resp.Body.Close()
	}
	return nil
}
func PostHttpOctet(print bool, update bool, url string, proxyName string) (respBody []byte, err error) {
	file, _ := os.Open(proxyName)
	defer file.Close()
	var req *http.Request
	body := &bytes.Buffer{}
	writer := multipart.NewWriter(body)
	part, err := writer.CreateFormFile("proxy", proxyName)
	if err != nil {
		clilog.Error.Println("Error writing multi-part: ", err)
		return nil, err
	}
	_, err = io.Copy(part, file)
	if err != nil {
		clilog.Error.Println("error copying multi-part: ", err)
		return nil, err
	}
	err = writer.Close()
	if err != nil {
		clilog.Error.Println("error closing multi-part: ", err)
		return nil, err
	}
	client, err := getHttpClient()
	if err != nil {
		return nil, err
	}
	clilog.Info.Println("Connecting to : ", url)
	if !update {
		req, err = http.NewRequest("POST", url, body)
	} else {
		req, err = http.NewRequest("PUT", url, body)
	}
	if err != nil {
		clilog.Error.Println("error in client: ", err)
		return nil, err
	}
	req, err = setAuthHeader(req)
	if err != nil {
		return nil, err
	}
	req.Header.Set("Content-Type", writer.FormDataContentType())
	resp, err := client.Do(req)
	if err != nil {
		clilog.Error.Println("error connecting: ", err)
		return nil, err
	}
	return handleResponse(print, resp)
}