- This C# library converts the JokeAPI at https://v2.jokeapi.dev/joke/Any into JSON.
- The library converts the incoming JSON to C# objects with properties for easy interaction in C# projects.
- It supports all of the returned data the API returns in JSON.
- Use exception handling in the application. Things go wrong.
- Built in .NET Standard 2.0
Joke
- error - (bool)
- category - Category of joke (string)
- type - single, two-part (string)
- joke - The text of the joke (string)
- safe - true, false (bool)
There are two methods of obtaining the JokeAPIV2.dll.
- Download the JokeAPIV2.dll file. Copy it to your Visual C# project.
- In your project that's using this code, reference the built DLL from the previous step:
- Project dropdown -> Add Reference -> Search for the created DLL file.
- Generally, the path is something like:
/JokeAPIV2/JokeAPIV2
- Clone this code with the GitHub desktop
- Open the project in Visual Studio
- Build the project
- In the project that's using this code, reference or copy the built DLL to your project from the previous step:
- Project menu -> Add Reference -> Search for the created DLL(s) file.
- Generally, the path is something like: ./JokeAPIV2/JokeAPIV2`
This repository contains an example project.
- Console Example
- Newtonsoft.Json - JSON parsing class
I am Bill Loring, an Information Technology Instructor at Western Nebraska Community College. I teach Information Technology Technical Support, CyberSecurity and Computer Science.
This library was created for a Visual C# introductory programming class as a tutorial. Students are given the opportunity to learn how to consume a public API without the underlying complexity of parsing json or xml. It reinforces OOP concepts of objects and properties, while being a fun and interesting project.
- 03/14/2021: Initial commit
I am an Information Technology Instructor at Western Nebraska Community College. I teach Information Technology, CyberSecurity and Computer Science. Best job ever!
- Facebook: Facebook WNCC IT Program
- YouTube: YouTube WINCC IT Program
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Copyright (c) 2021 William A Loring