0 votes

Hello my friends.
I am trying to develop a tool which does api calls to fetch Conversations (from a ticket system) and then exports to a file.
Each conversation has 0 or more messages, and 0 or more notes, and can be accessed by /conversations/{id}/messages?page={page_number} and /conversations/{id}/notes?page={note_number}.
I am stucked at the API calls, because doing the HttpRequest.request doesn't stop the program execution.

A button calls do_request(user_to_find_conversations, conversation_page) which does $ConversationRequest.request(url, h, true, HTTPClient.METHOD_POST, JSON.print(body)) (ignore the methods, cause the API works this way).
In the _on_ConversationRequest_request_completed signal I increment the page conversation_page += 1 and I call again do_request (because I want to fetch the next page), and when finish, emit a signal conversations_finished to call _on_conversations_finishedfor running the get_messageswhich does exatcly the same behaviour as conversations. And later with notes...

No matter what, I have two kind of results, or the execution runs without waiting for finish do_request, or I get HTTPRequest is processing a request. Wait for completion or cancel it before attempting a new one.

I have 3 HTTPRequest Nodes for handle the 3 endpoints (Conversations, Messages, and Notes)

Any help is much appreciated.

asked Nov 19, 2019 in Engine by UnsignedFoo (26 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.