Author Topic: Executing HFS scripts from curl  (Read 805 times)

0 Members and 1 Guest are viewing this topic.

Offline newbie

  • Occasional poster
  • *
  • Posts: 27
    • View Profile
Executing HFS scripts from curl
« on: October 03, 2019, 03:10:29 PM »
Hello,
How do I execute a HFS script from curl.
For e.g to create a folder, the HFS:_scripting_commands doc says that I need to use the script: mkdir|foldername

So, how do I use it in curl. I am trying to create a folder called: hfsserver:port/Parent/Child

I tried:
curl -u user:passwd hfsserver:port/Parent/ -XPOST -d "{mkdir|Child}"
and it didnt work.

Thanks.

Offline dj

  • Tireless poster
  • ****
  • Posts: 167
  • 👣 🐾
    • View Profile
    • PWAs
Re: Executing HFS scripts from curl
« Reply #1 on: October 04, 2019, 03:13:02 AM »
welcome,
I searched on the forum for you

Code: [Select]
curl "http://localhost/test/?mode=section^&id=ajax.mkdir"  --data "name=Child"

Offline newbie

  • Occasional poster
  • *
  • Posts: 27
    • View Profile
Re: Executing HFS scripts from curl
« Reply #2 on: October 04, 2019, 01:43:24 PM »
DJ, Thanks for your response.

So,
This didnt work:
curl "http://localhost/test/?mode=section^&id=ajax.mkdir"  --data "name=Child"

but this did:
curl "http://localhost/test/?mode=section&id=ajax.mkdir"  --data "name=Child"
Note the lack of the character ^

I think this gives me a good start on the rest of my reqs. The mkdir was the easiest of my req.
I think the HFS & its scripting capabilities is a powerful tool, but it would be really helpful, if there is an example section in the documentation describing how to get started after settings up the HFS server.
And, I am not talking about just to doing it on curl. There is a lot of documentation & snippets on the forum, but it wasnt clear to me how to get started in the first place.

Follow members gave a thank to your post:



Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1912
    • View Profile
Re: Executing HFS scripts from curl
« Reply #4 on: October 04, 2019, 06:23:52 PM »
the holy grail or the cherry on the cake

http://rejetto.com/forum/index.php?topic=1939.0

 ;D

Offline newbie

  • Occasional poster
  • *
  • Posts: 27
    • View Profile
Re: Executing HFS scripts from curl
« Reply #5 on: October 07, 2019, 03:23:52 PM »
Thank you Mars & SilentPliz for those links. Thats a lot of doc/information.

I have another question:
Does HFS support querying a path to check if its a:
- file
- folder
- symbolic link

And, if so how?

Thanks