Suggestion: Request context information
See original GitHub issueI’d like to add the ability of a Request or maybe Call to carry some additional contextual information. I’m curious if this has been considered before. Or any thoughts for how to approach this, e.g. an immutable Map on Request.
I’m bastardising request.tag in my own project to carry an optional auth token or “pointer”.
sealed class Token {
open fun name(): String? = null
}
val DefaultToken = TokenSet("default")
data class TokenSet(val name: String) : Token() {
override fun name(): String? = name
}
data class TokenValue(val token: Any) : Token()
object NoToken : Token()
Used to override the auth token that a preregistered authenticator should use e.g. None, Default, “Work”, “Accounts”, “Personal”, or even a programmatically provided one.
e.g.
val response = client.query<Oauth2TokenResponse>(request("https://connect.squareup.com/oauth2/token", NoToken) {
postJsonBody(AuthDetails(clientId, clientSecret, code, s.redirectUri))
})
This works, but I’m fighting the OkHttp library to do it. It is terrible example code I can’t show anybody.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
The suggestion request object - Sitecore Documentation
Describes the structure and properties of the suggestion object in a Sitecore Discover Search and Recommendation request.
Read more >How to Make Subtle Requests and Suggestions Using ...
Learn how to make subtle requests and suggestions using implicature. We talk about the phenomenon in pragmatics called implicature and the purpose of ......
Read more >Suggester | Apache Solr Reference Guide 8.1
The SuggestComponent in Solr provides users with automatic suggestions for query terms. You can use this to implement a powerful auto-suggest feature in...
Read more >Context Clusters in Search Query Suggestions - SEO by the Sea
Google may use context clusters (or topics) to find query suggestions before a searcher has completed typing in a full query.
Read more >Suggesters | Elasticsearch Guide [8.5] | Elastic
The category context allows you to associate one or more categories with suggestions at index time. At query time, suggestions can be filtered...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We dropped it! https://github.com/square/okhttp/issues/2205
I’ll update the comments.