func PostProject(p models.Project, s *session.Session) error {
	ressource := "/projects"
	res, err := postData(ressource, s, p)
	if err != nil || res.Data == nil {
		return errors.New("Can't create project : %s")
	}
	return nil
}
/*
PostProject is a wrapper function to create a new project.
package requester
import (
	"github.com/mitchellh/mapstructure"
	"github.com/netm4ul/netm4ul/core/api"
	"github.com/netm4ul/netm4ul/core/database/models"
	"github.com/netm4ul/netm4ul/core/session"
	log "github.com/sirupsen/logrus"
	"bytes"
	"encoding/json"
	"errors"
	"io/ioutil"
	"net/http"
	"strconv"
	"strings"
)
func getURL(ressource string, s *session.Session) string {
	port := strconv.FormatInt(int64(s.Config.API.Port), 10)
	url := "http://" + s.Config.Server.IP + ":" + port + "/api/v1"
	if ressource != "" {
		url += ressource
	}
	return strings.TrimRight(url, "/")
}
func getData(ressource string, s *session.Session) (api.Result, error) {
	var result api.Result
	url := getURL(ressource, s)
	log.Debugf("GET : %s", url)
	client := &http.Client{}
	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		return api.Result{}, errors.New("Can't get create new request : " + err.Error())
	}
	req.Header.Set("X-Session-Token", s.Config.API.Token)
	res, err := client.Do(req)
	if err != nil {
		return api.Result{}, errors.New("Can't get " + ressource + " : " + err.Error())
	}
	defer res.Body.Close()
	data, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return api.Result{}, errors.New("Can't read json : " + err.Error())
	}
	err = json.Unmarshal(data, &result)
	if err != nil {
		return api.Result{}, errors.New("Can't decode json : " + err.Error())
	}
	if result.Code != api.CodeOK {
		return result, errors.New(result.Message)
	}
	return result, nil
}
func postData(ressource string, s *session.Session, rawdata interface{}) (api.Result, error) {
	var result api.Result
	jsondata, err := json.Marshal(rawdata)
	if err != nil {
		return api.Result{}, errors.New("Could not create project :" + err.Error())
	}
	url := getURL(ressource, s)
	client := &http.Client{}
	req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsondata))
	if err != nil {
		return api.Result{}, errors.New("Can't get create new request : " + err.Error())
	}
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("X-Session-Token", s.Config.API.Token)
	res, err := client.Do(req)
	if err != nil {
		return api.Result{}, errors.New("Could not post data " + err.Error())
	}
	err = json.NewDecoder(res.Body).Decode(&result)
	if err != nil {
		return api.Result{}, errors.New("Could not read response data " + err.Error())
	}
	return result, nil
}