Taobao platform C # sample code

Source: Internet
Author: User

Using system;

Using system. Collections. Generic;

Using COM. Taobao. API. util;

Using COM. Taobao. API;

Using system. net;

Using system. IO;

Using system. text;

Using system. Web;

Namespace Taobao. Open. API {

/// <Summary>

/// Taobao. Items. Get C # client API call example.

/// </Summary>

Public class itemsget

{

Public itemsget (){

Dictionary <string, string> req_params =

New Dictionary <string, string> ();

// System-level input parameter // app_key

Req_params.add ("app_key", "test ");

// Return format

Req_params.add ("format", "XML ");

// API method name

Req_params.add ("method", "Taobao. Items. Get ");

// Timestamp

Req_params.add ("timestamp", datetime. Now. tostring ("yyyy-mm-dd hh: mm: SS "));

// Version

Req_params.add ("V", "1.0 ");

// Application-level input parameters

// Return Field List

Req_params.add ("fields", "IID, title, Nick, pic_path, CID, price, type, location. City, delist_time, post_hour ");

// Query Conditions

Req_params.add ("Q", "iPhone 3G ");

// Secret, app secret key

String secret = "test ";

// Sign to generate a signature string

String Sign = encryptutil. Signature (req_params, secret, "sign ");

Req_params.add ("sign", sign );

// Call the API

Taobaojsonrestclient client = new taobaojsonrestclient ();

String responsebody = client. invokeapi (req_params); console. writeline (responsebody );}

Public static void main (string [] ARGs ){

// Call the API

Itemsget = new itemsget ();}}}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.