-1

Is there a Java wrapper for the current version of Stack Overflow? I have been looking at here and here, but they seem to be outdated for current API version. I keep getting connection refused when running their example code. I do have an API key.

StackExchangeApiQueryFactory queryFactory = StackExchangeApiQueryFactory.newInstance("MyApplicationKey");
    QuestionApiQuery query = queryFactory.newQuestionApiQuery();

List<Question> questions = query.withSort(Question.SortOrder.HOT).withPaging(new Paging(1, 20)).withTimePeriod(new TimePeriod(new Date(), new Date())).withFetchOptions(EnumSet.of(FilterOption.INCLUDE_BODY, FilterOption.INCLUDE_COMMENTS)).list();
2
  • Connection refused is happening at the network level, not the API level. You need to debug that first (IP address/hostname, port, firewall, etc) using Wireshark. Commented Jul 17, 2017 at 18:18
  • I have my proxy set up, and it's working fine with other things. I am getting an StackExchangeApiException. Commented Jul 17, 2017 at 18:28

1 Answer 1

0

This was an internal proxy mixup. Make sure your proxy is set properly. Also, if you are using an IDE, make sure that Automatic Proxy Configuration is chosen in its settings.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.