[oXygen-user] Custom headers on HTTP requests
Tue Dec 22 04:07:40 CST 2015
A solution to control the HTTP headers is to implement a custom protocol plugin. This plugin allows you to create your own URLConnection for an URL with a custom protocol other than the protocols handled by oXygen: file, http, https, ftp or ftps. When you are asked for an URLConnection, you can create a HTTPURLConnection which has API for setting custom headers.
If you want to use the HTTPConnection that oXygen uses, you have to instantiate the ro.sync.net.protocol.http.WebdavHttpURLConnection class. One of the advantages of using this class is that it is aware of the proxy options that are set in oXygen.
So, this solution implies that you will use a custom protocol when you want to access your files ( for instance cproto://host.com/dir1/dir2/file.xml). For this protocol, you will be asked for an implementation of URLConnection that allows you to set custom headers.
More about custom protocol plugin extension:
However, it is possible to impose a custom URL stream handler for the http protocol. This can be done through the 'Targeted URL Stream Handler' plugin. See more details here:
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
On 12/18/2015 4:41 PM, Tom Cleghorn wrote:
> Is there any means of controlling the HTTP headers Oxygen sends when
> using 'Open URL' from the File menu? I'm working with an API that uses
> Accept headers to return different subsets of a large document, and it'd
> be very useful to be able to control that within Oxygen too.
> Cambridge University Press is the publishing business of the University
> of Cambridge with VAT registered number GB 823 8476 09. Our principal
> office is at University Printing House, Shaftesbury Road, Cambridge, CB2
> 8BS, United Kingdom.
> oXygen-user mailing list
More information about the oXygen-user