Plugin and content type

hello

i have a plugin that defines REST endpoints

when i use soap ui to hit the endpoints... soap ui says "Not JSON content"

when i run the same search against the default ES URL
(i.e. http://localhost:9210/scnprobldir3a/item/_search ) rather than the
URLs defined in the plugin, the JSON content is properly displayed

I guess my question is...

how do i set the content type when returning data from a plugin like so...

channel.sendResponse(new StringRestResponse(OK, entity.toString()));
*
*
Thx !!!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

please check the hiercharchy of the StringRestResponse, you will see it
inherits from Utf8RestResponse, which defines its content-type.
You may need to set it to "application/json" manually, or better use a
another class, which extends AbstractRestResponse.

On Wed, Mar 13, 2013 at 5:52 PM, eric sanford
pcstechnologiesinc@gmail.comwrote:

hello

i have a plugin that defines REST endpoints

when i use soap ui to hit the endpoints... soap ui says "Not JSON content"

when i run the same search against the default ES URL (i.e.
http://localhost:9210/scnprobldir3a/item/_search ) rather than the URLs
defined in the plugin, the JSON content is properly displayed

I guess my question is...

how do i set the content type when returning data from a plugin like so...

channel.sendResponse(new StringRestResponse(OK, entity.toString()));
*
*
Thx !!!

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

thanks !!

i looked at the hierarchy, and all type have a contentType() method.. but i
dont see how i can set it (there is no setter)

On Wednesday, March 13, 2013 11:52:31 AM UTC-5, eric sanford wrote:

hello

i have a plugin that defines REST endpoints

when i use soap ui to hit the endpoints... soap ui says "Not JSON content"

when i run the same search against the default ES URL (i.e.
http://localhost:9210/scnprobldir3a/item/_search ) rather than the URLs
defined in the plugin, the JSON content is properly displayed

I guess my question is...

how do i set the content type when returning data from a plugin like so...

channel.sendResponse(new StringRestResponse(OK, entity.toString()));
*
*
Thx !!!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

On Wednesday, March 13, 2013 11:52:31 AM UTC-5, eric sanford wrote:

hello

i have a plugin that defines REST endpoints

when i use soap ui to hit the endpoints... soap ui says "Not JSON content"

when i run the same search against the default ES URL (i.e.
http://localhost:9210/scnprobldir3a/item/_search ) rather than the URLs
defined in the plugin, the JSON content is properly displayed

I guess my question is...

how do i set the content type when returning data from a plugin like so...

channel.sendResponse(new StringRestResponse(OK, entity.toString()));
*
*
Thx !!!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

i dont see how to set the content type. all types that implement
RestResponsehttp://rajish.github.com/api/elasticsearch/0.20.0.Beta1-SNAPSHOT/org/elasticsearch/rest/RestResponse.html seem
to have a contentType() method, which appears to be a getter... i cant
figure out how to set it

On Wednesday, March 13, 2013 11:58:21 AM UTC-5, Alexander Reelsen wrote:

Hey,

please check the hiercharchy of the StringRestResponse, you will see it
inherits from Utf8RestResponse, which defines its content-type.
You may need to set it to "application/json" manually, or better use a
another class, which extends AbstractRestResponse.

On Wed, Mar 13, 2013 at 5:52 PM, eric sanford <pcstechno...@gmail.com<javascript:>

wrote:

hello

i have a plugin that defines REST endpoints

when i use soap ui to hit the endpoints... soap ui says "Not JSON content"

when i run the same search against the default ES URL (i.e.
http://localhost:9210/scnprobldir3a/item/_search ) rather than the URLs
defined in the plugin, the JSON content is properly displayed

I guess my question is...

how do i set the content type when returning data from a plugin like so...

channel.sendResponse(new StringRestResponse(OK, entity.toString()));
*
*
Thx !!!

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

just override it in your own class then?

On Wed, Mar 13, 2013 at 6:15 PM, eric sanford
pcstechnologiesinc@gmail.comwrote:

i dont see how to set the content type. all types that implement
RestResponsehttp://rajish.github.com/api/elasticsearch/0.20.0.Beta1-SNAPSHOT/org/elasticsearch/rest/RestResponse.html seem
to have a contentType() method, which appears to be a getter... i cant
figure out how to set it

On Wednesday, March 13, 2013 11:58:21 AM UTC-5, Alexander Reelsen wrote:

Hey,

please check the hiercharchy of the StringRestResponse, you will see it
inherits from Utf8RestResponse, which defines its content-type.
You may need to set it to "application/json" manually, or better use a
another class, which extends AbstractRestResponse.

On Wed, Mar 13, 2013 at 5:52 PM, eric sanford pcstechno...@gmail.comwrote:

hello

i have a plugin that defines REST endpoints

when i use soap ui to hit the endpoints... soap ui says "Not JSON
content"

when i run the same search against the default ES URL (i.e.
http://localhost:9210/**scnprobldir3a/item/_searchhttp://localhost:9210/scnprobldir3a/item/_search) rather than the URLs defined in the plugin, the JSON content is properly
displayed

I guess my question is...

how do i set the content type when returning data from a plugin like
so...

channel.sendResponse(new StringRestResponse(OK, entity.toString()));
*
*
Thx !!!

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.