I am trying to receive the list of commits from a given stream and display it in unreal engine 4.
Since unreal engine supports Http requests I am trying to send a “POST” request to the graphQL server (https://speckle.xyz/graphql) by translating the provided curl command. However I receive a bad request as a response.
Is this path, copying the curl command from the “https://speckle.xyz/graphql” and trying to translate it as a HTTP post request a rational solution or I need a different route ?
remove the Connection: keep-alive header? (i don’t know how ue4 handles keep-alive connections, maybe it can cause issues)
the POST data should not contain --data-binary and -compressed. Those are not boundaries, are actual curl parameters that don’t need to be included in the POST data. so maybe just do:
Sure. So this is the GraphQL query that you want to run:
query{
stream (id: "2455b33e6b"){
id
name
commits{
totalCount
cursor
items{
id
referencedObject
}
}
}
}
In order to execute the query, you must make a POST request to the https://speckle.xyz/graphql API, by sending a query post parameter with your query. To send it via http, you must encode the post payload with json. So you get this json string that must be sent to the server:
Oh, I just found out that newlines are optional in the graphql query, so you can simplify it by removing the newlines
But the quote for the id is needed if you pass a string value in the graphql query. And so is escaping the quote when putting it inside a json field value