Welcome Guest, Not a member yet? Register   Sign In
Getting response body - trying to consume a web request from a service??
#1

[eluser]shoelessone[/eluser]
Hello all!

So, a tiny bit of backstory: I'm trying to build an endpoint for a service that I think is providing an Avro serialized bit of data. IE, I'm basically not sure what I'm doing, but I think I should be getting a string, which I will then un-serialize using some Avro library.

Anyway, the service automatically calls my URL, and my controller is being called with the following header data with this code:
Code:
foreach($this->input->request_headers() as $key => $thing){
   $header .= $key . " - " . $thing . "<br />";
  }
  log_message("info",( '1' . $header));

Now, the output is osmething like this:
Code:
1X-xc-tenant-id - VEVOQU5USUQtMQCxJDeT6bvdiiNm2rYo/lgloAuhLAYIxeq1m5Q4py7jnQ==
X-xc-publisher - TUFTS0RFU1QtMQAW9QJWJlI9lFOflvOfsrjzxqxVvKg3Y4BJuZNAmy5jXTnuT7KQ0SkFHAc7kUv+nvFav0Aqinn9dl1fCsN79iTo
Authorization - Bearer Sfjsaflksjer89fs49vdas29rLhn/qqOBsdafjew88fdsL=
X-xc-message-guid - ckslfa83-sf-ase49sfdasje-d44<br />Content-length - 680
Content-type - text/plain
Host - third.com
Connection - Keep-Alive
User-agent - Apache-HttpClient/4.1.1 (java 1.5)
Cookie - ci_session=a:4:{s:10:"session_id";s:32:"77890d37db7fa263925365bffd300e705d4c132f711f63a8d07744304
Cookie2 - $Version=1

Now, what I want, is some sort of data! An example I looked at in the ruby world does something like request.body.read to get the data that I'm trying to get, but I'm not sure how to do this here.

Can anybody give me any hints or tips?

Oh, also, FWIW the content is base64 encoded I believe.

<3




Theme © iAndrew 2016 - Forum software by © MyBB