Reqres – A hosted REST-API ready to respond to your AJAX requests

If you’re trying to demonstrate a front-end (JavaScript-based) concept, you don’t really want the hassle of setting up an API, or even a server (especially during a live workshop or demo).
You can just write your HTML, CSS & JavaScript as usual and send Reqres AJAX requests, which will respond with the expected response codes and output. Rapid prototyping of interfaces When prototyping a new interface, you just want an APIthere, with minimal setup effort involved. Normally, I’d point people, who aren’t too familiar with backend programming, to Sailsjs which can auto-generate a REST-API for you from the command line.
However, you will need Node.js installed and some familiarity of how Node.js works. If that sounds like too much hassle and way too daunting, Reqres is just a URL. Sending it an AJAX request is step 1…there is no step 2. Peace of mind It might seem pretty weird to be sending your data to a 3rd party API, but I can assure you, Reqres does not store any of your data at all. Once you send it to us, we just send it straight back…and then it’s gone!
reqres.in/

Log File Highlighter Extension – Visual Studio Marketplace

A Visual Studio Code extension for adding color highlighting to log files. It is based on standard conventions for log4net log files but it’s general enough to be useful for other variations of log files as well. The colors are customizable but by default the current color theme’s colors are used.

Source: Log File Highlighter – Visual Studio Marketplace

How the browser renders a web page – DEV Community

> My thinking: if I’m going to build websites that are fast and reliable, I need to really understand the mechanics of each step a browser goes through to render a web page, so that each can be considered and optimised during development. This post is a summary of my learnings of the end-to-end process at a fairly high level.
www.jstar.mx/blog/how-a-browser-renders-a-web-page

CSS Peeper – Chrome Css Extension

Extract CSS and build beautiful styleguides. 🔎 No more digging in a code. Inspect styles in a simple, well-organized & beautiful way. Get it now! CSS Peeper is a CSS viewer tailored for Designers. Get access to the useful styles with our Chrome extension. Our mission is to let Designers focus on design, and spend as little time as possible digging in a code. Ever wondered what’s the line-height, font or a button size on a website? We provide you the ultimate tool to satisfy your curiosity. We enable you to inspect code in the easiest possible way. Check the hidden CSS style of objects, colors and assets on the web.

Source: CSS Peeper – Chrome Web Store

Making ASP.NET Core 3 web API return REST compliant Http return codes

To make an ASP.NET Web Api (core 3+) return valid Http status codes such as 200 OK, 400 Bad request and 404 Not found, use the IActionResult as return type.

Return code 422 can be used instead of 400, read more here: HTTP Status Codes For Invalid Data: 400 vs. 422

Code example C# web API controller “data” endpoint method:

/// <summary>
/// Get data from API
/// </summary>
/// <remarks>
/// GET: api/v1/data?id={id}
/// </remarks>
/// <returns><see cref="IActionResult"/> <see cref="Data"/>Data model</returns>
/// <response code="200">Serialized <see cref="Data"/></response>
/// <response code="400">Invalid id</response>
/// <response code="404">Found no match for id</response>
[ProducesResponseType(typeof(Data), 200)]
[ProducesResponseType(typeof(object), 400)]
[ProducesResponseType(typeof(object), 404)]
[HttpGet("data")]
public IActionResult GetData(string id)
{
    var data = business.GetData(id);
    if (data == null)
    {
        return NotFound(null); //404 not found
    }
    if (data.IsValid)
    {
        return Ok(data); //200 OK, found
    }
    else
    {
        return BadRequest(data.ValidationErrorMessage); //400 bad reqeust validationerror
    }
}

IActionResult type

The IActionResult return type is appropriate when multiple ActionResult return types are possible in an action. The ActionResult types represent various HTTP status codes. Any non-abstract class deriving from ActionResult qualifies as a valid return type. Some common return types in this category are BadRequestResult (400), NotFoundResult (404), and OkObjectResult (200). Alternatively, convenience methods in the ControllerBase class can be used to return ActionResult types from an action. For example, return BadRequest(); is a shorthand form of return new BadRequestResult();.

Because there are multiple return types and paths in this type of action, liberal use of the [ProducesResponseType] attribute is necessary. This attribute produces more descriptive response details for web API help pages generated by tools like Swagger[ProducesResponseType] indicates the known types and HTTP status codes to be returned by the action.

More info:
Controller action return types in ASP.NET Core web API | Microsoft Docs
HTTP Status Codes For Invalid Data: 400 vs. 422