Skip to content
C

Build a REST URL

Mediumpython

Given an HTTP method, a resource name, and (optionally) an ID, construct the correct RESTful URL path following standard REST conventions.

Approach: if an ID is given, the path is METHOD /resource/id; if not (the id is the literal text None), the path is just METHOD /resource.

Input: Three lines: the HTTP method, the resource name, and the id (or the literal text None if there isn't one).

Output: One line: the constructed REST path, e.g. GET /students/5.

Input (stdin)

Output

Run your code to see output here...