← Back to team overview

launchpad-dev team mailing list archive

Re: Launchpad Web API - Authentication and Current State

 

Hi Colin,
Thanks for spotting that typo.The error however remains even after changing "customer" to "consumer".
Regards,
Kennedy
 

    On Friday, January 22, 2016 10:34 PM, Colin Watson <cjwatson@xxxxxxxxxxxxx> wrote:
 
 

 On Fri, Jan 22, 2016 at 09:08:00PM +0000, Kennedy Torkura wrote:
> Many thanks for responding.My code is below :
> public class tester {
>   public static void main(String[] args) throws ClientProtocolException, IOException{
>     CloseableHttpClient httpclient = HttpClients.createDefault();
>     HttpPost httpPost = new HttpPost("https://launchpad.net/+request-token";);    httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded");    // Content-type: application/x-www-form-urlencoded
>     List <NameValuePair> nvps = new ArrayList <NameValuePair>();    nvps.add(new BasicNameValuePair("oauth_customer_key", "myHPIClients"));    nvps.add(new BasicNameValuePair("oauth_signature_method", "PLAINTEXT"));    nvps.add(new BasicNameValuePair("oauth_signature", "%26"));    httpPost.setEntity(new UrlEncodedFormEntity(nvps));    CloseableHttpResponse response2 = httpclient.execute(httpPost);
                                                                                                      ^^^^^^^^^^^^^^^^^^

Try spelling this correctly as "oauth_consumer_key" and see if that
helps.

(I'm at the end of my day so haven't actually tried this code out yet,
but I spotted this from a quick read-through.)

-- 
Colin Watson                                    [cjwatson@xxxxxxxxxxxxx]


 
  

Follow ups

References