星座查詢示範樣本

來源:互聯網
上載者:User

標籤:style   http   color   io   os   ar   sp   2014   on   

星座查詢示範範例程式碼:

 using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Net.Security;

using System.Security.Cryptography.X509Certificates;

using System.Net;

using System.IO;

using System.IO.Compression;

using System.Text.RegularExpressions;

using System.Web.Script.Serialization;

namespace map

{

    class Program

    {

        static void Main(string[] args)

        {

            string key = "*********************";

            string consName="白羊座";

            string type="today";

            string url = "http://apis.haoservice.com/lifeservice/constellation/GetAll?consName="+consName + "&type=" + type + "&key=" + key;

            WebClient wc = new WebClient();

            wc.Encoding = Encoding.UTF8;

            string str = wc.DownloadString(url);

            Console.WriteLine(str);

            Console.ReadKey();

 

        }

    }

}

 

星座運勢介面返回樣本

介面資訊

URL:http://apis.haoservice.com/lifeservice/constellation/GetAll

支援格式:json

http請求方式:GET POST

DEMO:http://apis.haoservice.com/lifeservice/constellation/GetAll?consName=白羊座&type=today&key=您申請的APPKEY

返回結果:

/*今日或明日運勢格式*/

{

    "error_code": 0,                     /*返回碼*/

    "reason":"Success",

    result: {

        "name": "獅子座",                /*星座名稱*/

        "datetime": "2014年06月27日",    /*日期*/

        "date": 20140627,

        "all": "89%",                    /*綜合指數*/

        "color": "古銅色",               /*幸運色*/

        "health": "95%",                 /*健康指數*/

        "love": "80%",                   /*愛情指數*/

        "money": "84%",                  /*財運指數*/

        "number": 8,                     /*幸運數字*/

        "QFriend": "處女座",             /*速配星座*/

        "summary": "有些思考的小漩渦,可能讓你忽然的放空,生活中許多的細節讓你感觸良多。",/*今日概述*/

        "work": "80%",                   /*工作指數*/

    }

}

 

/*本周或下周運勢格式*/

{

    "error_code": 0,

    "reason":"Success",

    result: {

        "name": "白羊座",

        "date": "2014年06月29日-2014年07月05日",

        "weekth": 27,

        "health": "健康:內心有焦躁,但身體拒絕過勞求舒適。容易有胃部不適。",

        "job": "求職:雖有新想法,但心態求穩當,容易低就。但較有可能從家人處獲得的機會。",

        "love": "戀情:之前積累的想法和感受,本周選擇說出來。溝通機會增多,亦有可能以爭吵的方式出現。",

        "money": "財運:雖有自己的理財想法,但總體受控於家人或家族的財務計劃。",

        "work": "工作:水逆在本周結束,之前耽誤、錯過的出現彌補機會。有調部門或崗位的可能。"

    }

}

 

 

備忘:

1.首先在 http://www.haoservice.com/docs/32  網頁上申請key值,然後再運行示範範例程式碼.

2.若有錯誤可參考錯誤碼

錯誤碼表:

 

 返回碼  說明

 0  成功

 10001  錯誤的請求KEY

 10002  該KEY無請求許可權

 10003  KEY到期

 10004  錯誤的SDK KEY

 10005  應用未審核逾時,請提交認證

 10007  未知的請求源,(伺服器沒有擷取到IP地址)

 10008  被禁止的IP

 10009  被禁止的KEY

 10011  當前IP請求超過限制

 10012  當前Key請求超過限制

 10013  測試KEY超過要求節流

 10020  介面維護

 10021  介面停用

 10022  appKey按需剩餘請求次數為零

 10023  請求IP無效

 10024  網路錯誤

 10025  沒有查詢到結果

星座查詢示範樣本

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.