Introduction to php taobao api development_PHP tutorial

WBOY
Release: 2016-07-13 10:54:28
Original
966 people have browsed it

It’s interesting to see the Taobao API, and I’ll learn the PHP tutorial by the way

http://open.taobao.com/

After looking at the API calling method, it is to assemble the URL and then send an http request to interact with the server

See here for the specific principles: http://open.taobao.com/dev/index.php/Quick Start Guide

Look at the official demo, there are two types: using SDK and not using SDK. I don’t like SDK and can’t see the mechanism of background implementation

Look at the code of PHP without SDK: http://open.taobao.com/dev/index.php/php%e8%b0%83%e7%94%a8%e7%a4%ba %e4%be%8b%e4%bb%a3%e7%a0%81

util.php

There are two functions in it, one to generate md5 signature and one to assemble url

Then call these two functions according to the parameters, send http requests, and process the returned results

I probably understand the principle, just copy and paste and run it

Paste the code and run it. . . http 500 error. . .

This is embarrassing, I am also a beginner in PHP, so I have to bite the bullet and find the mistakes

1. The sentence between the two functions in util.php: if ($key != ' ' && $val != ' ') is missing the quotation marks

2. This comment on the main file: //Sandbox environment call address There is something wrong with the space in front of it, just delete it

. . . This official demo is too funny

It finally works, and a bunch of messy stuff is returned, which is completely different from what the API tool returns

http://my.open.taobao.com/apitools/apitools.htm

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632327.htmlTechArticleIt’s interesting to see the taobao api. I also learned the php tutorial http://open.taobao.com/. The way to call the api is to assemble the URL and then send an http request to interact with the server. The specific origin...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!