Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3997318
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:23:14+00:00 2026-05-20T07:23:14+00:00

So I’m working with the Signpost OAuth library for Java. I’m running into some

  • 0

So I’m working with the Signpost OAuth library for Java. I’m running into some complications using the Apache Commons HTTP library with it. Take a look at the following code:

URL url = new URL("http://api.neoseeker.com/forum/get_pm_counts.json");
HttpRequest request = (HttpRequest) url.openConnection();

consumer.sign(request);

request.connect();

System.out.println("Response: " + request.getResponseCode() + " "
        + request.getResponseMessage());

This is taking from this example. You can see that request used to be a HttpURLConnection, but because I’ll be using the Apache Commons HTTP library, I changed it to a HttpRequest object. Now, I’m getting errors when I call connect(), getResponseCode(), and getResponseMessage(), because those functions are for a HttpURLConnection. What functions from HttpRequest would I use so I can get the code to compile and run correctly? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:23:14+00:00Added an answer on May 20, 2026 at 7:23 am

    Signpost has a seperate module for using Apache’s HTTP client. You need to use a CommonsHttpOAuthConsumer for this.

    This module lives here – http://code.google.com/p/oauth-signpost/downloads/detail?name=signpost-commonshttp4-1.2.1.1.jar&can=2&q=

    Some sample code to use it is here – http://code.google.com/p/oauth-signpost/wiki/ApacheCommonsHttp4, but it just comes down to instantiating a CommonsHttpOAuthConsumer instead of the normal one…

    If you use maven, the coordinates are here, I couldn’t find them documented anywhere when I was trying to figure this out…

    <dependency>
        <groupId>oauth.signpost</groupId>
        <artifactId>signpost-commonshttp4</artifactId>
        <version>1.2.1.1</version>
    </dependency>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.