Am 17.08.2020 um 09:25 schrieb Christian Grün:
Hi Andreas,
Before we fix the outcome, we should have a look at the initial HTTP response. I assume the following function invokes http:send-request?
1. let $data := local:get-article($token, concat($local:ahost,
$link))/json
True. It's just a simple wrapper around `http:send-request#1`, that takes care of setting up the `http:request/` element and issues it, returning the `http:response/`:
declare function local:get-article( $token as element(json), $link as xs:string) { let $request := <http:request href="{$link}" method="get"> <http:header name="Authorization" value="{$token/token__type/data() || ' ' ||$token/access__token/data()}"/> <http:header name="User-Agent" value="{$local:user-agent}"/> </http:request> return http:send-request($request) };
Could you supply us with the full HTTP response (header and body)?
Sure. I am going to send it privately to you, since the cookie data may contain secrets. Note, that the data in question can be found in a JSON-key named `body_html`.
Do you have the REST API under control?
No. It is the Reddit API, documented here[1]. I use it according to [2].
[1]: https://www.reddit.com/dev/api/ [2]: https://github.com/reddit-archive/reddit/wiki/OAuth2-Quick-Start-Example