You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I faced a minor problem when I used it. API's JSON response can't used in API's JSON request.It's improtent for some P2P communicate Server.
To Reproduce
Steps to reproduce the behavior, if applicable:
The api code is
type request {
Bytes []byte `json:"bytes"`
Name string `json:"name"`
}
type response {}
service template { @handler postDataTest
post /test (request) returns (response) // this API just simply fmt.Printf("receive :%s",request)
@handler getJsonData
get /get returns (request)
}
2. `/get` API returns Struct like this,or some other []byte like Hash256 result, pubKey....
```go
types.Request{
Bytes: []byte("11122344wsss"),
Name: "test",
}
I visit /get and pass get result into /test
some error happend fullName: bytes, error: string: MTExMjIzNDR3c3Nz, error: `invalid character 'M' looking for beginning of value```
Expected behavior
Logic code in /test print "["11122344wsss","test"]" in console
Screenshots
Environments (please complete the following information):
OS: Windows10
go-zero version 1.2.1
goctl version 1.7.2
More description
I fixed it, and I alse make a pr. You can review it in the test file
The text was updated successfully, but these errors were encountered:
Describe the bug
I faced a minor problem when I used it. API's JSON response can't used in API's JSON request.It's improtent for some P2P communicate Server.
To Reproduce
Steps to reproduce the behavior, if applicable:
The api code is
}
type response {}
service template {
@handler postDataTest
post /test (request) returns (response) // this API just simply
fmt.Printf("receive :%s",request)
}
I visit
/get
and passget
result into/test
some error happend
fullName:
bytes, error:
string:MTExMjIzNDR3c3Nz
, error: `invalid character 'M' looking for beginning of value```Expected behavior
Logic code in
/test
print "["11122344wsss","test"]" in consoleScreenshots
Environments (please complete the following information):
More description
I fixed it, and I alse make a pr. You can review it in the test file
The text was updated successfully, but these errors were encountered: