hibrid0 Active Member Licensed User Longtime User Oct 20, 2019 #1 Hi, I my friends. I want to know if exist any GraphQL library for B4a, B4J. Or any example. I'm learning it and migrating from API Rest.
Hi, I my friends. I want to know if exist any GraphQL library for B4a, B4J. Or any example. I'm learning it and migrating from API Rest.
DaniDPX Member Licensed User Longtime User Apr 18, 2020 #2 Possible to use GraphQL API calls inside B4X by translating it in to Curl version and use it with POST request GraphQL Query example: query{ employees{ id name } } Curl example: curl \ -X POST \ -H "Content-Type: application/json" \ --data '{ "query": "{ employees{ id name }}" } \ http://localhost:4000 Upvote 0
Possible to use GraphQL API calls inside B4X by translating it in to Curl version and use it with POST request GraphQL Query example: query{ employees{ id name } } Curl example: curl \ -X POST \ -H "Content-Type: application/json" \ --data '{ "query": "{ employees{ id name }}" } \ http://localhost:4000
Roberto P. Well-Known Member Licensed User Longtime User Apr 14, 2021 #3 hibrid0 said: Hi, I my friends. I want to know if exist any GraphQL library for B4a, B4J. Or any example. I'm learning it and migrating from API Rest. Click to expand... found something? I have the same need Upvote 0
hibrid0 said: Hi, I my friends. I want to know if exist any GraphQL library for B4a, B4J. Or any example. I'm learning it and migrating from API Rest. Click to expand... found something? I have the same need
DonManfred Expert Licensed User Longtime User Apr 14, 2021 #4 Roberto P. said: found something? I have the same need Click to expand... See #2 Upvote 0
Roberto P. Well-Known Member Licensed User Longtime User Apr 14, 2021 #5 DonManfred said: See #2 Click to expand... Noted and thanks. but I hope for a more complete example ... Upvote 0
DonManfred said: See #2 Click to expand... Noted and thanks. but I hope for a more complete example ...
V VittorioBarile Member Licensed User Jun 15, 2021 #6 you can do a GET request! If you need to send Authorization Bearer, remember to send it from header B4X: Dim job As HttpJob job.Initialize("", Me) job.Download($"https://www.../graphql?query={yourQuery}"$) job.GetRequest.SetHeader("Content-Type", "application/json") job.GetRequest.SetHeader("Authorization", $"Bearer ${access_token}"$) job.GetRequest.SetHeader("Accept", "application/json") Upvote 0
you can do a GET request! If you need to send Authorization Bearer, remember to send it from header B4X: Dim job As HttpJob job.Initialize("", Me) job.Download($"https://www.../graphql?query={yourQuery}"$) job.GetRequest.SetHeader("Content-Type", "application/json") job.GetRequest.SetHeader("Authorization", $"Bearer ${access_token}"$) job.GetRequest.SetHeader("Accept", "application/json")
Erel B4X founder Staff member Licensed User Longtime User Jun 16, 2021 #7 Content type should be set with job.GetRequest.SetContentType. Otherwise it will be overwritten. Upvote 0