class TikToker::Request
- TikToker::Request
- Reference
- Object
Overview
A TikToker::Request
is a wrapper around an URI
to represent a TikTok
API request.
request = TikToker::Request.new("/api/post/item_list/")
request.add("secUid", "0x1111")
request.to_s # => "https://m.tiktok.com/api/post/item_list?secUid=0x1111"
Defined in:
tiktoker/request.crConstructors
Instance Method Summary
- #[](*args, **options)
- #[](*args, **options, &)
- #[]?(*args, **options)
- #[]?(*args, **options, &)
-
#add(name : String, value) : Nil
Sets (and overrides) the name query param to value.
-
#build : String
Builds the request URL.
- #has_key?(*args, **options)
- #has_key?(*args, **options, &)
- #query_params(*args, **options)
- #query_params(*args, **options, &)
-
#to_s : String
Builds the request URL.
- #uri : URI
Constructor Detail
Instance Method Detail
def add(name : String, value) : Nil
#
Sets (and overrides) the name query param to value.
request = TikToker::Request.new("/")
request.add("did", "0x1111111")
request.has_key?("did") # => true
request["did"] # => "0x1111111"
def build : String
#
Builds the request URL.
request = TikToker::Request.new("/")
request.add("secUid", "0x1111111")
request.to_s # => "https://m.tiktok.com/?secUid=0x1111111"
def to_s : String
#
Builds the request URL.
request = TikToker::Request.new("/")
request.add("secUid", "0x1111111")
request.to_s # => "https://m.tiktok.com/?secUid=0x1111111"