Home > database >  Pb and the Internet interface interaction
Pb and the Internet interface interaction

Time:10-10

The age of the Internet, at the current mainstream technology, personal feel involved in the following three aspects:

A, generating the json data
This not too much difficulty in pb, according to the json format specifications, the data in the datastore to write a string cycles with respect to OK, don't spend much time
Second, json generated rows
This will speak some skills, datastore is a very important function: according to the XML format to import data, using the importstring () function, so, as long as the way to the XML file generated from the json string, quickly can be implemented, the key to deal with this problem is to parse the json, and spell into XML format, this just understand XML specification and json norms, patient string analysis, write cycle, the problem is not big, because in the datastore defines an XML format (a XML sketchpad) easily, so write a public function turn json into XML, and then in the XML sketchpad into XML template you generate template, this also can write their own, not to the Internet to find a plugin
The datastore generated from the json data rows, benefit very much, first of all, it is easy to do the update () operation; Second, it is easy to business logic, data, and we were using pb, not said
In this part, note that the XML reserved symbol escape: & lt; ,> , & amp; The three symbols must escape, or json once it is in the range of values, the three symbols are generated in the range of values of the XML, importstring () will be an error, what circumstance value contains the three symbols? Ha ha, not to be considered generally did not experience, let me tell you: that is the nickname WeChat users, or consignee name

Three, the encoding of the string conversion, and subdivided into base64 encoding and utf8 encoding
Pb in their dealings with the coding format, I summed up the points:
1. The blob () function to generate value is base64 encoding, use string (blob) decoding
2. If the other interface is base64 string, use a blob to receive in the pb script, and then use the string () to extract, if use type string to receive, will soon find it can't use string () to decode, by this time have to find the object of the third party, and not seek
Transcoding between 3. Utf8 and unicode, you need to use the string () function, and the string () is only in view of the blob is encoded transformation, so that the original data must use a blob to receive, then convert
If you can't achieve the freedom to encode conversion, PB basically out of the Internet: the PHP website interface, mostly utf8 encoding and mutual communication gibberish, don't have never

Solve the three aspects of things, it is easy to interface to interact with various web site program, it was the younger brother in the three aspects of knowledge, smoothly and WeChat part of interface interaction,

A bit of a mouthful, but when used carefully thinking, can understand

CodePudding user response:

Base64 string namely originally I think your 3.1 and 3.2 is wrong

CodePudding user response:

The building Lord, what do WeChat interface?

CodePudding user response:

Top, also pay attention to this

CodePudding user response:

Pb + WeChat I feel difficulty is not great, because WeChat encryption approach is simpler, I've seen alipay interface is more troublesome, because pay treasure with asymmetric keys, you need to use the public key private key to add solution to sign, this is estimated to have pb can not complete,

CodePudding user response:

refer to the second floor zhangyangziwo response:
the building Lord, what do WeChat interface?


Take the token's interface, and interface WeChat store
Personal feel WeChat shop still quite good of, have solved the problem of payment transactions, and don't have to own server. Programmers only need to pay attention to cancel after verification, save time and effort

CodePudding user response:

reference 1/f, xiajinxian response:
base64 string is wrong I think your 3.1 and 3.2

Well. Base64 string. I want to express is a blob of pb () and the string () can realize the base64 encoding and decoding. Should be my statement is wrong

CodePudding user response:

reference 4 floor jiang396 response:
pb + WeChat I feel difficulty is not great, because WeChat encryption approach is simpler, I've seen alipay interface is more troublesome, because pay treasure with asymmetric keys, you need to use the public key private key to add solution to sign, this estimate pb can't finish now,


Well, to learn from you, haven't research to pay treasure

CodePudding user response:

Can refer to the following example here including provide json data services and pb via HTTP get json,
http://download.csdn.net/detail/pcwe2002/9523299

CodePudding user response:

Have a look, and learn,

CodePudding user response:

Learning the
Keep pace with The Times

CodePudding user response:

PB WEBAPI how to call, please?

CodePudding user response:

Mk tags, used to study again,

CodePudding user response:

Leave a mark to learn later,

CodePudding user response:

Leave a mark after learning,

CodePudding user response:

Indeed, PB call interface development, convenient a lot, feeling has a little bit of life,
  • Related