davestewart

davestewart

Front end developer at Freelance

Member Since 4 Years Ago

London

Experience Points
50,555
Total
Experience

4,445 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
157
Lessons
Completed
Best Reply Awards
56
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 11
50,555 XP
Sep
11
1 month ago
Activity icon

Replied to REST Purity - 200 OK Vs 201 Created

So I think I have answered my own question:

9 Method Definitions > 9.5 POST

https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5

The actual function performed by the POST method is determined by the server and is usually dependent on the Request-URI.

The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a database.

The action performed by the POST method might not result in a resource that can be identified by a URI.

In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the response includes an entity that describes the result.

HTTP POST

https://restfulapi.net/idempotent-rest-apis/

Generally not necessarily POST APIs are used to create a new resource on server.

Activity icon

Started a new Conversation REST Purity - 200 OK Vs 201 Created

Outline

We have a web app (SPA) where on one of the pages, the user can edit and submit a list of items (stock codes, quantities).

This is done using a Grid component, like Google Sheets, and works great.

As the user types, we do GET requests to populate additional columns with information such as price calculations, descriptions, etc, etc.

The user can then set a name for the list, then POST the whole thing as JSON.

Additional functionality - file upload

However, the user can also upload a CSV or XLS with the codes and quantities.

We have it set up so as soon as the user selects a file it uploads transparently in the background, and the the list is populated with the result. This works very similarly to how it works when typing.

Problem

However, the developer in charge of this feature wants to change the implementation and says we must submit the name and file without any background upload, then and then redirect to the edit/:id version of the URL to see the results and continue.

Apparently, the way we are doing it now is not proper REST (he says it doesn't create a resource and so he won't return the converted results) and he is refusing to back down on the matter even though the users love it.

This results in a poor UX for the user because if they want to use a file, they HAVE to fill out the whole form, create a resource, and redirect.

Bear in mind, this is an SPA so we don't have the same constraints as a regular HTML form on the front end.

So...

What's the deal here?

Surely returning a 200 with the results of the POST to a related endpoint would be OK?

If not, is there some way we can do this that will not offend his "pure" sensibilities?

Would appreciate some impartial input, thanks.