Building a WGET string.

If doesn't fit into any other category ....
Post Reply
AndyGadget
Posts: 222
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 120 times
Been thanked: 132 times

Building a WGET string.

Post by AndyGadget »

In my never-ending search of the interwebs in search of interesting free APIs to fiddle with I came across an AI based one which will generate a block of related text from a seed phrase. The site suplies a free API key and expects the seed phrase as a parameter but I am having trouble formatting a WGET command to get the API to respond.

More generally, would someone please explain to me the building blocks of a WGET string, specifically the difference between the header and 'payload', the use of & and ? and what needs to be a literal (') within the overall string.
(I'm sure this would help others, not just me :D )

And a follow-up question; What is the receive buffer size on the non-bluetooth version of Annex32?

This is the curl command : (There are other language examples on the site : https://deepai.org/machine-learning-mod ... -generator )

Code: [Local Link Removed for Guests]

curl \
    -F 'text=YOUR_TEXT_URL' \
    -H 'api-key:quickstart-QUdJIGlzIGNvbWluZy4uLi4K' \
    https://api.deepai.org/api/text-generator
Annex code :

Code: [Local Link Removed for Guests]

A$ =WGET$("https://api.deepai.org/api/text-generator?api-key:'quickstart-QUdJIGlzIGNvbWluZy4uLi4K'",1)
wlog NewString$
Which returns :

Code: [Local Link Removed for Guests]

log
HTTP/1.1 401 Unauthorized
Date: Wed, 04 Aug 2021 13:59:57 GMT
Content-Type: application/json
Content-Length: 78
Connection: keep-alive
Status: 401 Unauthorized
Vary: Origin, Cookie
Referrer-Policy: same-origin
X-Frame-Options: ALLOWALL
X-Content-Type-Options: nosniff
X-Powered-By: Phusion Passenger
Server: nginx + Phusion Passenger

{"status": "Please pass a valid Api-Key in a HTTP header called \"Api-Key\" "}

Really annoyingly, my BitDefender AV is still blocking me posting to ciccio.com and this post disappeared into the ether first time round - I forgot to copy it 'just in case'. :evil:
Post Reply