Com. Weibo. SDK. Android. weiboexception: {"error": "user does not exists !", Bytes

Source: Internet
Author: User

The following error is reported when you call the interface for Obtaining user information after Sina Weibo authorization (the user does not exist ):

Com. Weibo. SDK. Android. weiboexception: {"error": "user does not exists! "," Error_code ": 20003," request ":"/2/users/show. JSON "}

If you look at the Sina source code, you will find that this error is actually a very naive problem. Why do you say this? Let's take a look at the source code first:

/*** Obtain user information based on the user ID ** @ Param uid * the user ID to be queried. * @ Param listener */Public void show (Long UID, requestlistener listener) {weiboparameters Params = new weiboparameters (); Params. add ("uid", UID); Request (server_url_prix + "/Show. JSON ", Params, httpmethod_get, listener);}/*** obtain user information by user ID ** @ Param screen_name * the nickname of the user to be queried. * @ Param listener */Public void show (string screen_name, requestlistener listener) {weiboparameters Params = new weiboparameters (); Params. add ("screen_name", screen_name); Request (server_url_prix + "/Show. JSON ", Params, httpmethod_get, listener );}

After reading this, you may suddenly realize that if the input is a string, the following interface is called by default, so user does not exists will be reported!

If the input is of the long type, the above interface is called to query user information based on the UID.


PS: Do not use UID as a string to call the interface!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.