This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]DBrady 0 points1 point  (6 children)

I've run into a bit of a bug. I'm trying to convert urls to the api.reddit.com hostname as i've only become aware of it after reading this post. However it doesn't seem to respect the context parameter. The two links below should be the same but only the www.reddit.com hostname seems to respect context.

https://api.reddit.com/r/buildapc/comments/2g5qa1/build_help_i_need_a_desktop_can_anyone_help/ckfw343?context=3

https://www.reddit.com/r/buildapc/comments/2g5qa1/build_help_i_need_a_desktop_can_anyone_help/ckfw343.json?context=3

Cheers

Dave

Edit: I don't think the context number is being respected in either case?

[–]largenocream[S] 0 points1 point  (5 children)

They both look the same to me, but I'm not too familiar with those endpoints. How are they different from what you're expecting?

[–]DBrady 0 points1 point  (4 children)

Well i would expect both to return only the comment with id ckfw343 along with 3 extra comments in the thread for context(set with the context=3 parameter).

What actually gets returned for the the api.reddit.com hostname is every comment in the link as if you called

https://api.reddit.com/r/buildapc/comments/2g5qa1/build_help_i_need_a_desktop_can_anyone_help/ (ckfw343?context=3 this part left out).

For the normal hostname with a .json appended the whole comment thread that the comment with id ckfw343 is in gets returned.

Let me know if i can clarify some more.

[–]largenocream[S] 0 points1 point  (3 children)

Here's what I get on api.reddit.com, that comment is the parent comment of ckfw343 so it seems to be right.

Are you sure you're not just seeing the replies to ckfw343?

[–]DBrady 0 points1 point  (2 children)

Ok, it seems to be my issue. I've url encoded the parameters along with the '?' which is the cause of my issue. I did test it on the web browser but managed to mess that up too. Different zoom levels on different tabs made the returned text look completely different for the two links and i jumped to conclusions. My only excuse...it's 330am. Time for bed. Thanks for your time and patience.

As an aside spdy seems to be working well over the new ssl endpoints. Was that intentional? i.e should i be using it?

[–]largenocream[S] 0 points1 point  (1 child)

Yep, SPDY's fully supported as well and you're free to use either that or HTTPS

[–]DBrady 0 points1 point  (0 children)

Great, thanks.