Git Product home page Git Product logo

baidutongji's Introduction

百度统计Api调用

对于百度统计Api的使用案例

·访问DataApi服务

在使用 DataApi 服务之前,您首先要进行登录操作,在成功陆后会得到用户id (ucid)和会话 id (st)
接着就可以使用此进行DataApi调用。DataApi服务会对您的请求进行处理并返回相应信息
您的客户端程序需要对消息进行解析。

传输数据分消息头和消息体两部分
·消息头:HTTP(S) Header中用户需传递相应参数
·消息体:消息体(HTTP POST的内容)是一个经过压缩和加密后的内容

用方需要首先将登录请求对象转换成JSON格式,编码采用UTF-8,然后用GZIP对消息JSON串进行压缩。 压缩完毕后,采用RSA算法的公钥进行加密。 由于密钥为1024位,所以最多对117个字符进行加密,超过则进行分块(117字符为1块)加密,再拼接。 最多支持加密2047个字符。

服务器响应都包含消息头和数据。

消息头由8个字节组成,分成4个整数,每个整数包含2个字节高位在前。
第一个整数表示return code,表明请求成功与否及错误的具体代码。第二~第四个整数位保留字段
数据部分为GZIP压缩过的JSON串

·调用DataApi服务

调用前提:成功登录获取用户id(ucid)及会话id(st)。
仅支持post请求,设置编码为UTF-8 传输数据分消息头和消息体两部分
·HTTP(S) Header中需传递相应参数
·消息体是一个JSON串

baidutongji's People

Contributors

justlive1 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.