findItemsByCategory通过country-ebay api过滤响应

时间:2017-10-10 15:50:28

标签: c# asp.net-mvc

我正在尝试使用国家/地区域值“EBAY-GB”过滤“findItemsByCategory”的ebay响应(这是针对英国网站)但问题是我添加此代码与AddHeader我得到美国ebay网站响应。有没有想过按ebay的国家代码过滤?

Documentation1 Documentation2

  

http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByCategory&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=YourAppID&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&categoryId=10181&paginationInput.entriesPerPage=2

public ActionResult Search(string categoryId)
        {
            //api configs

            string OperationName = "findItemsByCategory";
            string AppId = "KloinHkm-B-PRD-6bf1-97d25";

            string Url = "http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME="+OperationName+"&SERVICE-VERSION=1.0.0&SECURITY-APPNAME="+AppId+"&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&categoryId="+categoryId+"&paginationInput.entriesPerPage=110";
            var client = new RestClient(Url);
            var request = new RestRequest(Method.GET);
            request.Method = Method.GET;
            request.AddHeader("X-EBAY-SOA-GLOBAL-ID", "EBAY-GB");
            request.Parameters.Clear();
            //request.AddParameter("application/json", obj, ParameterType.RequestBody);
            var response = client.Execute(request).Content;



            return View();
        }

0 个答案:

没有答案