Sending an api request in a plugin

How can I send an API request in a plugin, e.g. to change a user’s data? Preferably, with no need to specify an API key?
Thanks.

Or, is there a way to not use requests to URLs, instead using built-in classes or methods (e.g. PostCreator)?

1 Like

Read up about MVC.

Requests → Controllers → Models

Use the Rails Models.

Experiment on the rails console using models.

eg

rails c
user = User.find_by(username: "harry")
user.username = "george"
user.save!
user.username

etc etc.

This is the very basics of code that is placed in plugins.

3 Likes

Thanks! This seems like what I’m looking for; I’ll take a look.

1 Like