|
- //获取淘宝服务器当前时间,返回的是json数据
- package com.taobao.api.demo.onsale;
- import com.taobao.api.DefaultTaobaoClient;
- import com.taobao.api.request.TimeGetRequest;
- import com.taobao.api.response.TimeGetResponse;
- public class ApiTest {
- public static void main(String[] args) throws Exception {
- DefaultTaobaoClient client = new DefaultTaobaoClient("http://gw.api.taobao.com/router/rest", "你的App Key", "你的App Secret");//App Key 和 App Secret怎么来,百度一下,一大把
- TimeGetRequest request = new TimeGetRequest();
- TimeGetResponse response = client.execute(request);
- if (response.isSuccess()) {
- System.out.println(response.getBody());
- }
- }
- }
复制代码
|
|