Please advise, the following doesn’t produce a valid PNG file. I tried removing the headers, but it still didn’t work.
Thanks!
curl -X POST --include ‘https://textvis-word-cloud-v1.p.mashape.com/v1/textToCloud’ -H ‘X-Mashape-Key: <private>’ -H ‘Content-Type: application/json’ -H ‘Accept: text/plain’ --data-binary ‘{“text”:“This is a test. I repeat, this is a test. We are only testing the functionality of this api, nothing else. End of test.”,“scale”:0.5,“width”:800,“height”:800,“colors”:["#375E97","#FB6542","#FFBB00","#3F681C"],“font”:“Tahoma”,“use_stopwords”:true,“language”:“en”}’ -o “image.png”
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 16369 100 16098 100 271 18332 308 --:–:-- --:–:-- --:–:-- 19210
azureuser@host:~$ file image.png
image.png: ASCII text, with very long lines, with CRLF line terminators
Join in the discussion - add comment below:
Sure! You would have to use javascript to do this. Below is an example. You have to put in your mashape key instead of the text “ENTER YOUR MASHAPE KEY HERE” for it to work.
Oh cool, could you show me how to call the above using HTML?
Hi! The response is base64 encoded and has to be converted to png to be used as a png-file. However, it works fine to add it do the “src”-attribute of an img-tag on a website. If you tell me more about your use case I can probably point you in the right direction as to how to best fix it.