You can convert cURL command to AppInventor blocks hassle free
Preiview
How to?
Copy & Paste curl text into the textbox
Hover over generated blocks and click download image
Drag and drop downloaded image to AppInventor workspace
Report bug if found
cURL to blocks by Getaix is inspired from CurlToBlocks by @HritikR .
CurlToBlocks by Getaix is still in beta and would like to know your reviews.
Update 2024-08-11T18:30:00Z
AI blocks generator here
[image]
Hey Guys,
I'm excited to annouce latest update to Getaix cURL to Blocks
[image]
What's New !
Create blocks for any online service with AI tool
For example,
"Create api call for ChatGPT send message"
Check more examples here -> Getaix cURL to Blocks
With this tool you can generate minimal blocks for your api call and avoid large extensions
Dark theme, More comfortable view
Improved with dictionaries and list
Feel it - You can no…
Thank you
Jerin Jacob
6 Likes
Peter
December 20, 2021, 7:30am
2
Nice work.
Just for my curiosity.....
I tried to convert this
curl -X POST https://www.oseamiya.tech/ -H "Authorization: Header" -H "Content-Type: application/json" -d "{"key" : "value"}"
This is the result from @HritikR his website
This is from yours
Can you tell why you added the posttext block in the end result?
1 Like
Thanks for checking it out.
This is the result I got when giving the curl input you mentioned
It is a post request as you can see in the curl text and also there is -d field which is data to send during post request.
Let me know if I'm wrong
Can you try real curl with -d field and test result from both website on AppInventor?
Thank You
Jerin Jacob
1 Like
Peter
December 20, 2021, 8:28am
4
Didn't check the code just copy and pasted it to look at the blocks generated.
1 Like
TIMAI2
December 20, 2021, 9:37am
5
@Jerin_Jacob
I also got some strange results - I used the bug report google form...
1 Like
Thanks for informing and checking Getaix.
I checked the website mentioned in Google form and some curl in that.
If possible can you share the curl and generated image.
Thank you
Horizon
December 20, 2021, 10:02am
7
Will anyone explain me what is CURL
I am fully confused on that
The above text is curl command, most of the API docs will have curl snippet for their API.
Check the website to see some examples and read the FAQ
2 Likes
TIMAI2
December 20, 2021, 10:14am
10
curl -d "client_id=<client_id>&scope=https://www.googleapis.com/auth/drive.file" https://oauth2.googleapis.com/device/code
the end of the scope url is missing
curl -d client_id=<client id> -d client_secret=<client secret> -d device_code=<device code> -d grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code https://accounts.google.com/o/oauth2/token
>
not set, and the url is wrong/missing
curl -X POST -L \
-H "Authorization: Bearer <enter access token here>" \
-F "metadata={name :'<our.zip>'};type=application/json;charset=UTF-8" \
-F "file=@<our.zip>;type=application/zip" \
"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart"
most of the metadata
value is missing
2 Likes
First one is good , the scope url ends here
TIMAI2:
drive.file"
In Second one , you need to change the below values with real values , the <> makes it difficult to parse the curl
TIMAI2:
<client id>
TIMAI2:
<client secret>
Third one I will look detailly.
Thank you for checking
TIMAI2
December 20, 2021, 10:48am
12
Jerin_Jacob:
In Second one
I found if I put the key:pair items after each -d
in quotes then it works...
curl -d "client_id=<client id>" -d "client_secret=<client secret>" -d "device_code=<device code>" -d "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code" https://accounts.google.com/o/oauth2/token
2 Likes
curl is a command to execute a api in one statement this curl to blocks by jerin converts a curl command to ai2 blocks so that we know how do we do it in ai2 using curl.
2 Likes
Horizon
December 20, 2021, 11:55am
14
Thanx @Aarush_Kumar Now i got it
1 Like
@Jerin_Jacob great tool , amazed to find -u
working in your tool
TIMAI2
December 22, 2021, 5:03pm
18
@Jerin_Jacob
For the three cURL stanzas I provided, when in App Inventor, I found that the dictionaries did not work, the blocks had to be written out like this (nothing like the ones provided by the tool):
curl -d "client_id=<client_id>&scope=https://www.googleapis.com/auth/drive.file" https://oauth2.googleapis.com/device/code
curl -d client_id=<client id> -d client_secret=<client secret> -d device_code=<device code> -d grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code https://accounts.google.com/o/oauth2/token
curl -X POST -L \
-H "Authorization: Bearer <enter access token here>" \
-F "metadata={name :'<our.zip>'};type=application/json;charset=UTF-8" \
-F "file=@<our.zip>;type=application/zip" \
"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart"
I guess it all depends on what you are cURLing
It is certainly a useful tool to get started on the conversion.
5 Likes
very nice, to do a "curl" can not be used? (I've never been able to)
unfortunately the curl is installed in very few android, you probably all used virtualizers,i turned the web in all directions and couldn't figure out how to fix this. curl only works if it is installed on the device