-2

My URL is like -

https://api.insideview.com/api/v1/people/abcdef?active=true

here the arguments passed are people=abcdef and active=true

How can I incorporate both the parameters using get method-

My code is like-

public PeopleDetailInstance peopledetail(String peopleId) {
        HttpClient client = new HttpClient();
        GetMethod method = new GetMethod("https://api.insideview.com/api/v1/people/"+peopleId); 
4

3 Answers 3

1
... peopledetail(String peopleId, Boolean active) {
        HttpClient client = new HttpClient();
        GetMethod method = new GetMethod("https://api.insideview.com/api/v1/people/"+peopleId + "&active=" + active)

Edit - sorry by the bad format. Im in phone.

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

Comments

0

Now sure where your api url ends but query string should be
your url + ?parameter1="value"&parameter2="value"
https://yourApiUrl?people=peopleId&active=true

Comments

0

Try this

public PeopleDetailInstance peopledetail(String peopleId) {    
    URIBuilder builder = new URIBuilder();
    builder.setScheme("https")
        .setHost("api.insideview.com")
        .setPath("/api/v1")
        .setParameter("people", peopleId)
        .setParameter("active", "true")
    URI uri = builder.build();
    HttpGet httpget = new HttpGet(uri);
}

1 Comment

what is URIBuilder ? Java is unable to recognize it.

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.