Ejemplo n.º 1
0
        public virtual ofWorker Create(ofWorkerCreateOptions createOptions, ofRequestOptions requestOptions = null)
        {
            requestOptions = SetupRequestOptions(requestOptions);

            string serilizedObj = JsonConvert.SerializeObject(createOptions, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }).ToString();
            var PostData = new StringContent(serilizedObj, Encoding.UTF8, "application/json");
            var worker = Requestor.Post<ofWorker>(Urls.Workers, requestOptions, PostData);
            return worker;
        }
Ejemplo n.º 2
0
        public virtual ofWorker Create(ofWorkerCreateOptions createOptions, ofRequestOptions requestOptions = null)
        {
            requestOptions = SetupRequestOptions(requestOptions);

            string serilizedObj = JsonConvert.SerializeObject(createOptions, new JsonSerializerSettings()
            {
                NullValueHandling = NullValueHandling.Ignore
            }).ToString();
            var PostData = new StringContent(serilizedObj, Encoding.UTF8, "application/json");
            var worker   = Requestor.Post <ofWorker>(Urls.Workers, requestOptions, PostData);

            return(worker);
        }