Qiniu.Processing.Dfop.dfop C# (CSharp) Метод

dfop() публичный Метод

public dfop ( string fop, byte data ) : DfopResult
fop string
data byte
Результат DfopResult
        public DfopResult dfop(string fop,byte[] data)
        {
            DfopResult dfopResult = new DfopResult();
            HttpFormFile dfopData = HttpFormFile.NewFileFromBytes("netFx.png", "application/octet-stream", data);

            string dfopUrl = string.Format("{0}/dfop?fop={1}", API_HOST, fop);
            string token = Auth.createManageToken(dfopUrl, null, mac);

            Dictionary<string, string> dfopHeaders = new Dictionary<string, string>();
            dfopHeaders.Add("Authorization", token);

            RecvDataHandler dfopRecvDataHandler = new RecvDataHandler(delegate (ResponseInfo respInfo, byte[] respData)
            {
                dfopResult.ResponseInfo = respInfo;
                dfopResult.ResponseData = respData;
            });

            mHttpManager.postMultipartDataRaw(dfopUrl, dfopHeaders, dfopData, null, dfopRecvDataHandler);

            return dfopResult;
        }

Same methods

Dfop::dfop ( string fop, string url ) : DfopResult

Usage Example

Пример #1
0
        /// <summary>
        /// dfop形式1:URL
        /// </summary>
        public static void dfopUrl()
        {
            Mac mac = new Mac(Settings.AccessKey, Settings.SecretKey);
            Dfop dfx = new Dfop(mac);

            string fop = "FOP"; // E.G.: "imageInfo"
            string url = "RES_URL";

            var ret = dfx.dfop(fop, url);

            if (ret.ResponseInfo.StatusCode != 200)
            {
                Console.WriteLine(ret.ResponseInfo);
            }
            Console.WriteLine(ret.Response);
        }
All Usage Examples Of Qiniu.Processing.Dfop::dfop