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

  • Home
  • SEARCH
  • 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 889189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:31:43+00:00 2026-05-15T13:31:43+00:00

Usually when I get POST data it’s send from a HTML form and the

  • 0

Usually when I get POST data it’s send from a HTML form and the parameters has names, i.e. from <input type="text" name="yourname" />, then I can receive and print this data with php echo $_POST['yourname'];.

Now I am implementing a Java application that should POST data in XML format to a specified URL. I wrote a simple PHP page that I can try to POST data to, but the data is not printed. And since there is no name of any parameters I don’t know how I should print it with PHP.

I have tried to send simple XML to the server and the server should respond with MESSAGE: <XML>, but it only response with MESSAGE:. What am I doing wrong?

Here is my PHP-code on the server:

<?php 
echo 'MESSAGE:';
print_r($_POST); ?>

And here is my Java code on the client:

String xmlRequestStatus = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>
    <test></test>";
String contentType = "text/xml";
String charset = "ISO-8859-1";
String request = null;
try {
    request = String.format("%s",
        URLEncoder.encode(xmlRequestStatus, charset));
} catch (UnsupportedEncodingException e1) {
    e1.printStackTrace();
}
URL url = null;
URLConnection connection = null;
OutputStream output = null;
InputStream response = null;
try {
    url = new URL("http://skogsfrisk.se/test/");
} catch (MalformedURLException e) {
    e.printStackTrace();
}

try {
    connection = url.openConnection();
    connection.setDoOutput(true);
    connection.setRequestProperty("Accept-Charset", charset);
    connection.setRequestProperty("Content-Type", contentType);
    output = connection.getOutputStream();
    output.write(request.getBytes("ISO-8859-1"));
    if(output != null) try { output.close(); } catch (IOException e) {}

    response = connection.getInputStream();
    ...
} catch (IOException e) {
    e.printStackTrace();
}
  • 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-15T13:31:44+00:00Added an answer on May 15, 2026 at 1:31 pm

    No, $_POST array is being populated only with multipart/form-data enctype.

    you can use either fopen() with php://input wrapper or $HTTP_RAW_POST_DATA
    http://www.php.net/manual/en/wrappers.php.php

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

Sidebar

Ask A Question

Stats

  • Questions 514k
  • Answers 514k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Finalizers are run by the Garbage Collection before an object… May 16, 2026 at 6:08 pm
  • Editorial Team
    Editorial Team added an answer String[] a ={"BLAH00001","DIK-11","DIK-2","MAN5"}; for(String g:a) System.out.println(Integer.valueOf(g.split("^[A-Z]+\\-?")[1])); /******************************* Regex Explanation :… May 16, 2026 at 6:08 pm
  • Editorial Team
    Editorial Team added an answer Call make_crypto_hash when you initially set up the user, the… May 16, 2026 at 6:08 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I found the quoted text in Programming Python 3rd edition by Mark Lutz from
I am submitting from a form to another php page which is supposed to
I generally use $.get() and $.post() for all of my asynchornous calls, but they're
I know about Path.GetTempFileName() and how to get the temp folder (usually its on
I usually write web apps in PHP, Ruby or Perl. I am starting the
I have a page where the user sends data (via ajax) to a php
I am trying to log in to my website (www.trailbehind.com) and then send a
Just curious. How exactly does chatting in a browser work? Usually if a user
I've got a core data app with 2 views. The first view lists Rooms,
I've successfully built SDL from source using bcc 5.5.1 but any SDL test application

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.