// Make a request to the server
Make a request to the server
// Make a request to the server
func MakeRequest(config *accounts.ClientConfig, request *jobs.Request) *Response {
	url := config.GetUrl(request.Type)
	client := NewClient()
	buffer := datastore.Serialize(request)
	reader := strings.NewReader(string(buffer))
	headers := map[string][]string{
		"Authorization": []string{config.Token.Signed},
		"Name":          []string{config.Username},
	}
	status, _, read_closer, err := client.Post(url, headers, reader)
	if err != nil {
		switch err.(type) {
		default:
			log.Fatal("Get", err)
		}
	}
	if status.Code != httpc.SUCCESS_OK {
		return NewResponse("Post Status Failed", nil)
	}
	return NewResponse("Success", read_closer)
}
func MakeRequest ( config * accounts . ClientConfig , request * jobs . Request ) * Response { url := config . GetUrl ( request . Type ) client := NewClient ( ) buffer := datastore . Serialize ( request ) reader := strings . NewReader ( string ( buffer ) ) headers := map [ string ] [ ] string { " " : [ ] string { config . Token . Signed } , " " : [ ] string { config . Username } , } status , _ , read_closer , err := client . Post ( url , headers , reader ) if err != nil { switch err . ( type ) { default : log . Fatal ( " " , err ) } } if status . Code != httpc . SUCCESS_OK { return NewResponse ( " " , nil ) } return NewResponse ( " " , read_closer ) }
Make a request to the server
Make a request to the server
// TODO: Add in nicer error messages