Home > WeChat Applet > WeChat Development > Discussion of simple issues in WeChat development

Discussion of simple issues in WeChat development

Y2J
Release: 2017-05-03 10:09:31
Original
2058 people have browsed it

WeChat public platform developer document description:
[color=#33CCCC]When an ordinary WeChat user sends a message to a public account, the WeChat server will POST the XML data packet of the message to the URL filled in by the developer. The push XML data packet structure of each message type is as follows.
If the WeChat server does not receive a response within five seconds, it will disconnect the connection and re-initiate the request, retrying three times in total
Regarding retry message deduplication, it is recommended to use msgid deduplication.
If the server cannot guarantee to process and reply within five seconds, you can directly reply with an empty string. The WeChat server will not do anything with this and will not initiate a retry.
Text message

 <xml>
 <ToUserName><![CDATA[toUser]]></ToUserName>
 <FromUserName><![CDATA[fromUser]]></FromUserName> 
 <CreateTime>1348831860</CreateTime>
 <MsgType><![CDATA[text]]></MsgType>
 <Content><![CDATA[this is a test]]></Content>
 <MsgId>1234567890123456</MsgId>
 </xml>
Copy after login

Parameter Description
ToUserName Developer WeChat ID
FromUserName Sender account (an OpenID)
CreateTime Message creation time (integer)
MsgType text
Content Text message content
MsgId Message id, 64-bit integer[/color]
It means that the developer accepts the xml data packet POST from the WeChat server. After processing it here, it must be The same xml data format is sent back to the server.
So when sending back to the server, the ToUserName and FromUserName here remain unchanged? What will be the impact of changing the Content? Will it be sent to the sender’s account?

The above is the detailed content of Discussion of simple issues in WeChat development. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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