Using http-Headers via POST to receive individual response

4729
1
08-07-2015 07:43 AM
DominikSchlarmann
Occasional Contributor

Hello everyone,

In the HTTP-Tutorial on ArcGIS Online there are some explanations how to use http-Methods to send or to receive data. Sending data/ information is always done using http message body, for example I could send a json using the message-body.

But is it also possible to send information using the message header?

Let me explain this in more detail:

Using a REST-Endpoint of an Feature-Service I can request information tailored to my needs using the http-Headers.

Example:

http://sampleserver5.arcgisonline.com/arcgis/rest/services/ServiceRequest/FeatureServer/0/query?wher...

This example would result in a response, where only feature are included where the attribute "requesttype" is equal to "Animal Complaint".

For my purpose it would be great, if the following would work:

  1. Sending information via an http-POST-request using the http-headers (like latitude/longitude and some additional parameters)...similar to the example of the FeatureService RestEndpoint. Those information should be accepted by an Input-Connector.
  2. Those information ,which are sent using the http-headers, should be converted to GeoEvents.
  3. The GeoEvents should be processed by an GeoEvent-Service.
  4. The result of the GeoEvent-Service should be send back as the response of the request (step one).

Is there any way to realize this?

Thanks for any information!

0 Kudos
1 Reply
RJSunderman
Esri Regular Contributor

Hello Dominik -

The tutorial you referenced in your post above is seriously out-of-date. A couple of examples I spotted when skimming through it -- we no longer have an external GeoEvent Service Designer. The ability to design and publish GeoEvent Services was integrated into the GeoEvent Manager back at the 10.2.1 release. Also the GeoEvent Cache output has been depreciated, so you will not find it available out-of-the-box if you were to try and re-create the 'Poll an External website for JSON' exercose without using the product XML included with the tutorial.

I apologize if information you took from the tutorial's exercises resulted in any confusion.

I do not think you are able to use a GeoEvent service in the way you describe. A GeoEvent service expects event data to be sent to one of its inputs ... not to receive a request for event data.

From this perspective it makes sense that GeoEvent inputs do not honor HTTP / GET requests. They expect HTTP / POST requests with event data in the body of the request. The language here is kind of funny. You're not really making a "request" of a GeoEvent service ... like you might "ask" or "request" a feature service return to you features which satisfy a particular WHERE clause. With GeoEvent you are sending data to an input's adapter for the adapter to parse and use to create a GeoEvent. An event stream is then subject to filtering and processing by a GeoEvent service. The processed event(s) are then sent to an output.

A GeoEvent service is not really handling "requests". It is receiving, filtering, processing event data ... then sending that data out an output.

I believe if you were to HTTP / POST a request with information included as parameters in the request's header, the parameter information would be ignored. The URL is sufficient to deliver the request to a GeoEvent input ... and the input's adapter is only interested in taking information from the request's body, not from parameters accompanying the request.

If I have missed the point of your question, maybe if you can describe what you would like to see a GeoEvent service do with latitude and longitude coordinates (and other event attributes) it receives, I can suggest an approach. I don't think you'll be able to send event attributes as parameters ... they will have to be sent in the body of an HTTP / POST request.

Hope this information helps -

RJ

If there are particular tutorials which you would like to see updated, or content you expect in a tutorial's exercise which is missing, unclear, or appears to be out-of-date, please email the GeoEvent product team (geoevent@esri.com) and include GeoEvent Tutorial Feedback in the subject of your email.

0 Kudos