liveBook · Manning

Web service

As explained in .NET in Action, Second Edition

A web service is a software service that exposes functionality or data for interaction over a network, commonly through web protocols.

A web service exposes functionality or data over a network. In ASP.NET Core, a minimal API can make a console program’s function available through a GET endpoint. section 3.0 section 3.1

ASCII-art service

A GET route accepts text and returns its ASCII-art rendering; an optional font query parameter selects a font. section 3.1 section 3.1

Listing 3.5 Program.cs with ASCII art request handling
using Figgle;                              #1
  
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
 
app.MapGet("/", () => "Hello World!");
app.MapGet("/{text}",                      #2
  (string text) =>                         #3
  FiggleFonts.Standard.Render(text));      #4
  
app.Run();

See the route handler that passes text and an optional font to the rendering function. section 3.1

How .NET in Action, Second Edition covers it

How deep it goes
Builds a minimal ASP.NET Core service from an empty template, mapping GET routes and handling optional query input.
Examples
Ports an ASCII-art console program to GET endpoints, including a route that accepts text and an optional font query parameter.
What it assumes
Assumes familiarity with a console program and the dotnet CLI, while demonstrating service creation from an empty template.
What you can do after
Build it from scratch with ASP.NET Core’s empty web template and map GET endpoints for text-to-ASCII-art conversion.
How it connects
Connects web services with ASP.NET Core, minimal APIs, HTTP GET requests, and console applications.

Also explained in

Compare how 6 books explain web service →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET in Action, Second Edition. The section links point to the parts of the book it draws on.