Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTPS POST Response issue  RSS feed

 
Baz Matt
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • 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?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!