Class: Forem::RequestRedirect
- Inherits:
-
APIResource
- Object
- ForemObject
- APIResource
- Forem::RequestRedirect
- Extended by:
- APIOperations::Create, APIOperations::List, APIOperations::Retrieve, APIOperations::Update
- Includes:
- APIOperations::Delete, APIOperations::Save
- Defined in:
- lib/forem/resources/request_redirect.rb
Overview
Represents a request redirect used to map legacy or custom-domain paths to a destination URL.
Request redirects power organization custom domains: when a request
comes in for request_domain at path original_url, Forem redirects
the visitor to destination_url. Managing request redirects is an
admin-only operation and requires an admin API key.
Available operations (via mixins):
- +List+ — GET /api/admin/request_redirects
- +Create+ — POST /api/admin/request_redirects
- +Retrieve+ — GET /api/admin/request_redirects/:id
- +Update+ — PUT /api/admin/request_redirects/:id
- +Delete+ — instance-level delete (DELETE /api/admin/request_redirects/:id)
- +Save+ — instance-level save (create or update)
RequestRedirect Fields
original_url(String, required) — the incoming request path; must start with/and is unique perrequest_domaindestination_url(String, required) — the fully-qualified HTTP/HTTPS URL to redirect torequest_domain(String, required) — the domain the redirect applies to; normalized to lowercase by the server
The create/update endpoints require request bodies wrapped in a
request_redirect: key (the API uses strong parameters with
params.require(:request_redirect)), so callers of the class methods
here must supply that wrapper explicitly. Services::RequestRedirectService
handles the wrapping automatically for the friendlier, flat-params
service interface.
Constant Summary collapse
- OBJECT_NAME =
"request_redirect"- RESOURCE_PATH =
"/api/admin/request_redirects"
Instance Attribute Summary
Attributes inherited from ForemObject
Method Summary
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::Retrieve
Methods included from APIOperations::Update
Methods included from APIOperations::Save
Methods included from APIOperations::Delete
Methods inherited from APIResource
#refresh, resource_path, #resource_url
Methods inherited from ForemObject
#==, #[], #[]=, construct_from, cursor_list, #initialize, #inspect, #method_missing, paginated_list, #respond_to_missing?, #to_hash
Methods included from APIOperations::Request
Constructor Details
This class inherits a constructor from Forem::ForemObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Forem::ForemObject