This discussion is archived
0 Replies Latest reply: Jun 16, 2011 1:48 AM by 869206 RSS

Reading an InputStream

869206 Newbie
Currently Being Moderated
Hello,

I am challenged by something pretty simple. I create an HTTP POST request and I want to read the response body into a variable. The response body is always a single string of around 300 chars.

In plain Java, this is trivial. However, I can find no examples of doing it in JavaFX using HttpRequest. All the examples do useless things like print the number of bytes returned.

First, how the heck do you create a sized byte array in JavaFX? You can't do it with nativearray, it seems. So, the seemingly obvious method of creating a byte array, reading the InputStream into it, converting it to a string; is right out.

I have tried everything I can think of. Appreciate any help.

Thanks.

mp

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points