I’m working an lnd node and when utilizing command line i will pay an bill, however once I do it by way of my api I get two outcomes once I print the request, one saying failure_reason_none and one failure_reason_no_route, so it appears api is sending 2 funds makes an attempt on the identical time however I do not know why that’s occurring. The error being returned from the API: requests.exceptions.JSONDecodeError: Further knowledge: line 2 column 1 (char 827)
My view.py:
class Ship(APIView):
def put up(self, request):
url = f"https:myurl.com:8080/v2/router/ship"
TLS_PATH = "tls.cert"
print(TLS_PATH)
macaroon = join.encoded_hex
headers = {"Grpc-Metadata-macaroon": macaroon}
knowledge = {
"payment_request": request.knowledge["payment_request"],
"timeout_seconds": request.knowledge["timeout_seconds"],
}
r = requests.put up(
url, headers=headers, stream=True, knowledge=json.dumps(knowledge), confirm=TLS_PATH
)
if r.status_code == 200:
knowledge = r.json()
return Response(knowledge, standing=standing.HTTP_200_OK)
return Response({"error": "Request failed"}, standing=r.status_code)
my urls.py
urls.py
urlpatterns = [
path("admin/", admin.site.urls),
path("v1/", include("API.urls")),
path("v2/", include("API.urls")),
]
urls.py
path("router/ship", Ship.as_view()),
and that i despatched this request from postman on http://127.0.0.1:8000/v2/router/ship:
{
"payment_request":"<payment_req_from_phoenix_wallet>",
"timeout_seconds":6,
"outgoing_chan_ids":["856173212061597696"]
}
Thanks upfront for the assistance.
