Content-Type of http:response

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Content-Type of http:response

Tim Thompson
Hello,

I have a RESTXQ function that needs to return xs:base64Binary. I am using the EXPath HTTP module to send a request to a service that returns the binary data.

I have tried everything I could think of to set the Content-Type for the response[1], but it only ever returns application/xml. I don't believe this is required by the EXPath spec, is it? Is this a known issue?

Thanks in advance,

Tim

[1] For example, setting the Accept header in the request, adding the "override-media-type" attribute to the request element, adding a %rest:produces annotation, etc.

--
Tim A. Thompson
Metadata Librarian (Spanish/Portuguese Specialty)
Princeton University Library

www.linkedin.com/in/timathompson
[hidden email]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Content-Type of http:response

Tim Thompson
Sorry, I meant "application/octet-stream," not "xs:base64Binary."

Sent from my iPhone

On Mar 1, 2017, at 1:39 PM, Tim Thompson <[hidden email]> wrote:

Hello,

I have a RESTXQ function that needs to return xs:base64Binary. I am using the EXPath HTTP module to send a request to a service that returns the binary data.

I have tried everything I could think of to set the Content-Type for the response[1], but it only ever returns application/xml. I don't believe this is required by the EXPath spec, is it? Is this a known issue?

Thanks in advance,

Tim

[1] For example, setting the Accept header in the request, adding the "override-media-type" attribute to the request element, adding a %rest:produces annotation, etc.

--
Tim A. Thompson
Metadata Librarian (Spanish/Portuguese Specialty)
Princeton University Library

www.linkedin.com/in/timathompson
[hidden email]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Content-Type of http:response

Adam Retter
Hi Tim,

Can you share your RESTXQ resource function definition?


On 1 March 2017 at 18:43, Tim Thompson <[hidden email]> wrote:

> Sorry, I meant "application/octet-stream," not "xs:base64Binary."
>
> Sent from my iPhone
>
> On Mar 1, 2017, at 1:39 PM, Tim Thompson <[hidden email]> wrote:
>
> Hello,
>
> I have a RESTXQ function that needs to return xs:base64Binary. I am using
> the EXPath HTTP module to send a request to a service that returns the
> binary data.
>
> I have tried everything I could think of to set the Content-Type for the
> response[1], but it only ever returns application/xml. I don't believe this
> is required by the EXPath spec, is it? Is this a known issue?
>
> Thanks in advance,
>
> Tim
>
> [1] For example, setting the Accept header in the request, adding the
> "override-media-type" attribute to the request element, adding a
> %rest:produces annotation, etc.
>
> --
> Tim A. Thompson
> Metadata Librarian (Spanish/Portuguese Specialty)
> Princeton University Library
>
> www.linkedin.com/in/timathompson
> [hidden email]
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>



--
Adam Retter

eXist Developer
{ United Kingdom }
[hidden email]
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Content-Type of http:response

Tim Thompson
Hi, Adam. Sure, I've attached it here. By the way, a somewhat related issue, I noticed that eXist does not seem to support multiple body/header pairs in a multipart/form-data POST. I originally had a sequence of headers/bodies, but I had to remove all but the first in order for the request to work.

Thanks so much,

Tim

--
Tim A. Thompson
Metadata Librarian (Spanish/Portuguese Specialty)
Princeton University Library

www.linkedin.com/in/timathompson
[hidden email]

On Wed, Mar 1, 2017 at 2:36 PM, Adam Retter <[hidden email]> wrote:
Hi Tim,

Can you share your RESTXQ resource function definition?


On 1 March 2017 at 18:43, Tim Thompson <[hidden email]> wrote:
> Sorry, I meant "application/octet-stream," not "xs:base64Binary."
>
> Sent from my iPhone
>
> On Mar 1, 2017, at 1:39 PM, Tim Thompson <[hidden email]> wrote:
>
> Hello,
>
> I have a RESTXQ function that needs to return xs:base64Binary. I am using
> the EXPath HTTP module to send a request to a service that returns the
> binary data.
>
> I have tried everything I could think of to set the Content-Type for the
> response[1], but it only ever returns application/xml. I don't believe this
> is required by the EXPath spec, is it? Is this a known issue?
>
> Thanks in advance,
>
> Tim
>
> [1] For example, setting the Accept header in the request, adding the
> "override-media-type" attribute to the request element, adding a
> %rest:produces annotation, etc.
>
> --
> Tim A. Thompson
> Metadata Librarian (Spanish/Portuguese Specialty)
> Princeton University Library
>
> www.linkedin.com/in/timathompson
> [hidden email]
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>



--
Adam Retter

eXist Developer
{ United Kingdom }
[hidden email]
irc://irc.freenode.net/existdb


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open

multipart-test.xqm (2K) Download Attachment