Options for writing back end persisting processes?

Edit: time to RTFM, no need to spoon feed, those who deserve to live will work for it haha

Forgive me if this rambling/out of line

I creeped (I’m guilty!)

You had a Rest repository, I wanted to ask this

If you have say four URLs

edit: obv omitting other parameters like the details/idenfitication

somesite.com/?action=create_user
somesite.com/?action=read_user
somesite.com/?action=update_user
somesite.com/?action=delete_user

Say for me with LAMP, I can do that fine… is that REST?

I don’t understand, when I read about REST there’s the explanation of “resources” and “restful state” I just don’t get what makes something “REST” if I achieve the above, is that rest?

Assuming you have authentication going on JWT/oAUTH (something I still have to figure out)

Feel free to stop responding haha, I don’t know the etiquette here on Go Forum

That’s my most popular repository.

The general understanding of REST is that urls define resources and HTTP methods are used to manipulate those resources. To take your user example:

  • GET /users would list the users
  • POST /users would create a user, usually redirecting to the page that shows the user
  • GET /users/user_id would show the user (read_user)
  • PUT /users/user_id would update the user
  • DELETE /users/user_id would delete the user

In practice things get more complicated, but those are the basic conventions.

So if you can do that with any language that’s considered “REST” for some reason I thought/assumed “REST” meant something special. Granted I believe this is all more than likely using JSON / no GUI involved.

The double GET seem redundant but you could argue how would you identify without id (ampersand/concatenate/another parameter)

representational state transfer, it sticks but I don’t know what it means haha what is being represented or is it “literal” I don’t know not really a question.

Thanks a lot for everything hopefully I can be useful to Go and contribute someday (do the documentation). Still trying to build a ladder out of a pit with tooth picks.

edit: sorry if this causes a “push notification” or whatever you call it in this case.

What I wasn’t clear on, I see that everywhere the GET PUT, but I didn’t actually get what it meant. The header part. For example cloudinary’s API they have the resources, and although each language calls it differently, it still uses the same GET /url “resource”

I found a good link to look at though.

I guess my use/thought of AJAX with JavaScript to PHP with $.post (jQuery XHR) is not a RESTfull call… with regard to using CURL with PHP and sending specific headers… I’m still not clear but going to read up on it.

I listened to the latest Go Time podcast on The Change Log they mentioned that Go doesn’t really go well with MySQL but other options are available key-base or something… I don’t know. Also it sucks like a basic array_push (indeterminate size array) with Go you have to specify a size, but I did see that there is some “work around” or similar equivalent like array_push.

I think Go is what I’m going to commit to though. Will still improve my site using LAMP as it’s the fastest implementation and with simple code restructuring… but I’ll get there.

REST does mean something specific. It is an architectural style defined in Roy Fielding’s Dissertation. It can be implemented in most languages. There is also no limitation to JSON / no GUI. Generally speaking, the architecture of the web is REST.

There is no double get. Both the GETs get different URLs and therefore resources. /users is a list of all users. /users/user_id is a reference to a specific user. For example, https://forum.golangbridge.org/users/jdc-cunningham refers to you. When you GET the url by going to it, a representation (in html) of your user’s state is transferred to you.

1 Like

For example, Profile - jdc-cunningham - Go Forum refers to you. When you GET the url by going to it, a representation (in html) of your user’s state is transferred to you.

that’s well put

Yeah I thought it was “double get” seeing the word Get twice like I saw it twice on your repository but I understand it’s just showing use case/more explanation.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.