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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:33:01+00:00 2026-06-17T21:33:01+00:00

I am trying to send a request to a server using GET that will

  • 0

I am trying to send a request to a server using GET that will respond with XML. I am told that I need to set the “Accept” property, code follows:

StringBuffer url = new StringBuffer(BASE_URL);
url.append(DRS_SERVICE_RELATIVE_URL);
url.append("?").append(DOC_PARAM_NAME).append("=").append(docId);
url.append("&").append(DOB_PARAM_NAME).append("=").append(dob);

try
{
    this.server = new URL(url.toString());

    URLConnection urlCon = this.server.openConnection();
    HttpURLConnection con = (HttpURLConnection)urlCon;

    con.addRequestProperty("Accept", "text/xml, application/*+xml, application/xml, text/xml, application/*+xml");

    con.connect();

    input = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line = null;

    while((line = input.readLine()) != null)
        System.out.println(line);

I get response code 500. When I talk to the developers of the URL I am trying to access they say I am not setting the “Accept” property to XML? What am I doing wrong? How are you supposed to set that property?

EDIT:
OK this is embarassing. The problem had to do with my development enviroment, specifically the way I set up a TCP/IP monitoring tool. When I stopped monitoring the network messages it worked as expected.

  • 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-17T21:33:02+00:00Added an answer on June 17, 2026 at 9:33 pm

    The problem had to do with my development enviroment, specifically the way I set up a TCP/IP monitoring tool. When I stopped monitoring the network messages it worked as expected.

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

Sidebar

Related Questions

I'm trying to send json string in the get request to the server, here
Hello I'm trying to send a simple GET request using flex mx:HTTPService: <mx:HTTPService id=service
I wrote REST service using ASP.NET Web API. I'm trying to send HttpDelete request,
I'm trying to send a SOAP request using SOAPpy as the client. I've found
I'm trying to send a post request to Parse: https://parse.com/docs/rest#objects-creating . Can't get it
I'm trying to send a http get request in a php file to a
I'm trying to reproduce a POST request that was captured from WireShark using PHP.
I'm working on a project where I'm trying to send request to our webservice
I am trying to send a ajax request to my views.py but I dont
I am trying to send a POST request to a rails scaffold controller 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.