Response
skrape(AsyncFetcher) { // <-- could use any valid fetcher depending on your use-case
request {
// some request config
url = "https://some.url"
userAgent = "my fancy UA"
}
response { // 🍉 <-- response will make actual HTTP request and convert its response to a Result object
// the scope of 'this' inside the response lambda is Result!
// that means you can directly call any field or function of Result here.
// e.g. print the response body
println(responseBody)
// the last thing called inside the response lambda will be returned
// e.g. the status code
status { code }
}
}Fields
Functions
Last updated
Was this helpful?