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 8069373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:00:00+00:00 2026-06-05T13:00:00+00:00

I am trying to access a REST web service using HTTP GET request. For

  • 0

I am trying to access a REST web service using HTTP GET request.

For a example following URI provides Rest web service that return all the available parts for the given category.

http://localhost:8080/mycompany/parts/category

I want to authenticate/authorize users who are accessing above REST request in each time and I want to pass User authentication details (User Name and Token) with the HTTP Get Request.

Is there a possibility to cater to the above requirement in REST HTTP GET request (using HTTP header or query parameters)?

or

Is it better to use HTTP POST instead of HTTP GET?

  • 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-06-05T13:00:01+00:00Added an answer on June 5, 2026 at 1:00 pm

    Since you are getting information, you should use “Get”. Here’s the code that I use (it is Restlet based) for adding the oauth_token to the request…

    import org.restlet.data.Reference;
    import org.restlet.ext.oauth.OAuthUser;
    import org.restlet.representation.Representation;
    import org.restlet.resource.ClientResource;
    
    Reference commitsRef = new Reference(Consts.RESOURCE_BASE + "commitments/"); 
    OAuthUser u = (OAuthUser) request.getClientInfo().getUser();
    String token = u.getAccessToken();  
    ref.addQueryParameter("oauth_token", token);
    ClientResource commitsResource = new ClientResource(getContext(), commitsRef);
    Representation commitsRep = commitsResource.get();
    

    As mentioned, this is Restlet based, but there is probably something similar in the framework you are using. (And if you are not using a framework, Restlet can make this easier).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to access the REST Disqus API using the following url: http://disqus.com/api/3.0/threads/listPosts.json ?api_key=myKey
I'm trying to access rest service using ajax. If I'll paste this link on
I have a REST API that I am trying to access using Rails 3.0.1
I'm currently trying to access a REST API for the first time using visual
I'm trying to use HTTPWebRequest to access a REST service, and am having problems
Im trying to access the example/web folder (see below in the image) in a
When trying to access data-onload using $(#index).data(onload) I get back 'undefined' : <script type=text/html>
I am trying to create a WCF client that operates with an http rest
I'm trying to think of how to validate that a web service is only
I'm trying to deploy a web service onto WebSphere using a WAR file, which

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.