i using habbo api check if name valid. i'm recieving 401 unathorised error.
below code i'm using. worked when copied cookie header in chrome , added header. there way , actual fix?
private void form1_load(object sender, eventargs e) { try { using(webclient webclient = new webclient()) { webclient.headers.add("user-agent", "mozilla/5.0 (linux; u; android 4.0.3; ko-kr; lg-l160l build/iml74k) applewebkit/534.30 (khtml, gecko) version/4.0 mobile safari/534.30"); messagebox.show(webclient.downloadstring("https://www.habbo.com/api/user/avatars/check-name?name=123")); } } catch (exception ex) { messagebox.show(ex.tostring()); } }
the api https://www.habbo.com/api/user/avatars/check-name
referring wont load without proper authorization token, since 1 not public available.
to further test, use public api https://www.habbo.com/api/public/users?name=
you able response without issues.
Comments
Post a Comment