• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTTPS POST response format

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This may seem like a simple question. I`m reading the response from a HTTPS POST request that I made by getting hold of the input stream.

I`m sending the query parameters in the request by writing it into the output stream and reading back the response using the input stream..

I used to get the same query string that I sent, back to me with the token value populated.

For eg: Query String sent in Request: ID = value1 &key = value2&token = value3

Modified Query String sent back in response ID = value1&key = value2&token = 12345

The problem is that now they have changed the way they are sending back the response and are now forwarding the response to our proxy server with Query string in the URL.

By the time I read the response, I lose the query string because it gets modified by the proxy server and I get an entire HTML page corresponding to the URL.

So, from the perspective of the Server sending the response, it appears to be fine as they are sending the modified query string in the url. But from my perspective, I have no use for the URL(no use of browser, Im doing this at code level)..Im not sure how to explain to them that instead of forwarding the URL, I just need to read the response parameters in the input stream. Any advise in what format I should ask them to send the response.

Sample code:

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I understand correctly, the proxy server is under your control - if that's the case, why is it set to mess with the URL?

It sounds a bit as if the "forwarding" actually converts a POST into a GET request - POST requests normally do not have query parameters, whereas GET requests do.
 
Baz Matt
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you understood correctly...But I don't have access to the Proxy server. Otherwise, I could have maybe written a filter to intercept the incoming url and check for the query parameters. As a workaround, if I could get them to have the response sent through their output stream, I could just get the content in the POST response. But, this does not make sense to them in the live environment.
Since, I just need a string as the response, wouldn't it be better for them to send it in the Output stream? And I am using SSL, so data will be encrypted..
 
Baz Matt
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Simply put, in this scenario, is it better to ask them to send the content I need in the body of the HTTP response?
 
reply
    Bookmark Topic Watch Topic
  • New Topic