-
-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging messages in its raw format #32
Comments
你可以通过访问
|
Thanks a lot! |
Strange, why my Here is my <?xml version=\"1.0\"?><br/><msg><br/>\t<img aeskey=\"93dc26e94e7764eb58621e7906321570\" encryver=\"0\" cdnthumbaeskey=\"93dc26e94e7764eb58621e7906321570\" cdnthumburl=\"30780201000471306f02010002048b8fde7b02033d096802045d8b2065020460f781ca044a617570696d675f623761333130636266336265663536365f313632363833333335333632395f62346139313765342d366162362d343463622d383432312d3730306362353532376665350204012d0a020201000400\" cdnthumblength=\"7486\" cdnthumbheight=\"107\" cdnthumbwidth=\"120\" cdnmidheight=\"0\" cdnmidwidth=\"0\" cdnhdheight=\"0\" cdnhdwidth=\"0\" cdnmidimgurl=\"30780201000471306f02010002048b8fde7b02033d096802045d8b2065020460f781ca044a617570696d675f623761333130636266336265663536365f313632363833333335333632395f62346139313765342d366162362d343463622d383432312d3730306362353532376665350204012d0a020201000400\" length=\"62022\" md5=\"2d585878ca83673d9852c61b790afd1b\" hevc_mid_size=\"62022\" /><br/></msg><br/> |
Hmm, no, that's not the kind of raw format that I am talking about. For e.g., this is,
This is a
etc |
Found the source, Would it be possible that you cache this (or maybe before here): |
The reason behind that is that, I want to collect every possible raw messages openwechat can received, and use CI/CD automation to automatically generate Go date structure for them. |
我觉得不用呀,因为它已经被转换了 |
Hmm... the point is that I want to verify if the process of 转换成Message结构体 is solid. Basically different types (3, 5, 51, 54 etc) have totally different date structures, as we can see from the above linked examples, I want to verify if they indeed have been converted properly. I.e., it is hard to believe that different types, different date structures, can all be converted to the same Message结构体 properly. |
For e.g., this is straight from
|
Right after login, I'd receive at least two messages:
I wish to see the raw Payload of the above 2 messages as well. I tried to make the following simple changes:
index f807d00..f43b3e0 100644
--- a/caller.go
+++ b/caller.go
@@ -3,6 +3,7 @@ package openwechat
import (
"bytes"
"errors"
+ "fmt"
"net/http"
"net/url"
"os"
@@ -195,6 +196,13 @@ func (c *Caller) WebWxSync(request *BaseRequest, response *WebInitResponse, info
return nil, err
}
defer resp.Body.Close()
+
+ var buffer bytes.Buffer
+ if _, err := buffer.ReadFrom(resp.Body); err != nil {
+ return nil, err
+ }
+ fmt.Println("PL: ", string(buffer.Bytes()))
+
var webWxSyncResponse WebWxSyncResponse
if err := scanJson(resp, &webWxSyncResponse); err != nil {
return nil, err But my code would hang because of that. Verified many times by flipping them on & off. Don't know why it is that, :(. It'll be nice to see the raw Payload, but let me park the idea for a while... |
会不会是你上面将 |
Ah, it must be then. THX! |
I still need such raw-format dumping function badly. @eatmoreapple, please think of a way so that I can get it. So far, the best way I can think of is to define a global variable, and set it within @eatmoreapple, please implement anything so that I can get the raw message strings received from the WX server without any modification. This is for my #64 implementation. Thanks! |
Hmm... hold on, let me investigate a fiddler-recording-alike solution first... |
Following up on #31, if I want to collect different raw message strings received by
openwechat
and display them in terminal, what shall I do?The purpose of this is that, when I got an attachment, say a .pdf file, I want to see if the file name is anywhere within the message itself. And same for other cases like getting pictures, or voices, etc.
You can use code in README or from #9 as the starting point. THX!
The text was updated successfully, but these errors were encountered: