BITGO - 无法按要求获得哈希

时间:2018-01-07 23:45:42

标签: python django

从BitGo API调用以立即从webhook获取地址接收BTC的密钥是什么。

从我的ngrok,我看到了这个

{
    "hash": "26ba9cc3218962417f529803d82dd63850b895fbee74517dff",
    "type": "transaction",
    "coin": "bitcoin",
    "walletId": "2Mzb4KMAp"
}

所以当我在'hook callback url'中执行以下操作时,我收到错误。 500错误。

1. txId  =  request.POST.get('hash')
2. txId = request.GET['hash']
3. txId = request.POST['hash']

如何获取哈希,因为上述所有方法都失败了。我正在使用Python / Django。

1 个答案:

答案 0 :(得分:1)

BitGo API将使用POST将JSON数据发送到您的终端:https://bitgo.github.io/bitgo-docs/#webhook-notifications

您可能需要将其POST请求的正文从JSON转换为可以更轻松访问的Python字典。您可以使用json.loads执行此操作:

C:\Users\user\Desktop\curl-7.57.0\winbuild>nmake /f Makefile.vc mode=static VC=14 MACHINE=x64 DEBUG=no

Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

configuration name: libcurl-vc14-x64-release-static-ipv6-sspi-winssl
Could Not Find C:\Users\user\Desktop\curl-7.57.0\winbuild\LIBCURL_OBJS.inc
Could Not Find C:\Users\user\Desktop\curl-7.57.0\winbuild\CURL_OBJS.inc
        cl /O2 /DNDEBUG /MD /DCURL_STATICLIB /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL /I"../../deps/include"  /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES  /DUSE_IPV6  /DUSE_WINDOWS_SSPI /DUSE_SCHANNEL /Fo"..\builds\libcurl-vc14-x64-release-static-ipv6-sspi-winssl-obj-lib/file.obj"  ..\lib\file.c
file.c
../include\curl/curl.h(49): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.