Browse Source
Merge pull request #348 from gdlcf88/binpayload-empty
Make the nil and empty of the `BinPayload` equivalent
pull/350/head
yedf2
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
1 deletions
-
dtmsvr/trans_status.go
|
|
|
@ -141,13 +141,17 @@ func (t *TransGlobal) getHTTPResult(uri string, branchID, op string, branchPaylo |
|
|
|
SetHeader("Content-type", "application/json"). |
|
|
|
SetHeaders(t.Ext.Headers). |
|
|
|
SetHeaders(t.TransOptions.BranchHeaders). |
|
|
|
Execute(dtmimp.If(branchPayload != nil || t.TransType == "xa", "POST", "GET").(string), uri) |
|
|
|
Execute(t.determineHttpRequestMethod(branchPayload), uri) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
return dtmcli.HTTPResp2DtmError(resp) |
|
|
|
} |
|
|
|
|
|
|
|
func (t *TransGlobal) determineHttpRequestMethod(branchPayload []byte) string { |
|
|
|
return dtmimp.If(len(branchPayload) != 0 || t.TransType == "xa", "POST", "GET").(string) |
|
|
|
} |
|
|
|
|
|
|
|
func (t *TransGlobal) getJSONRPCResult(uri string, branchID, op string, branchPayload []byte) error { |
|
|
|
var params map[string]interface{} |
|
|
|
dtmimp.MustUnmarshal(branchPayload, ¶ms) |
|
|
|
|