• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

HTTPS POST Response issue

Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone, I have a small problem with respect to reading a HTTP response and am stuck at one point.
Appreciate any inputs to push me in the right direction.

I`m trying to send a HTTPS POST request to a 3rd party agency that converts the Credit card info that I send and sends back a token.
I was working with their test environment and everything seemed to be working fine. I opened up a HTTPSURLConnection and sent the
request in a query string by using the Output Stream. Then I read the response using the InputStream. When sending the response, they sent back the same query string that I sent and replaced the credit card number with the new token.

But, I was informed that this was just a dummy response and that in the Production environment, they would forward the response to
our servers application url with a session id which we might choose to send to them in the request.
After this change, when I try readng the response, what I get in the InputStream is the HTML page content corresponding to the URL that they are forwarding the response to.

But this does not make any sense to me as I`m using a HTTPURLConnection and expect to read the response programmatically. I`m not sure what good there is in forwarding the response in this scenario. Usually in these cases, do the sender and receiver agree on the format of the response?
Posts: 43026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure there is a "usual" approach - it is indeed up to both sides to agree on the flow of the interaction. If they even have a test server I'm surprised that they don't have read-to-run example code.
Hey cool! They got a blimp! But I have a tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic