.. oe:namespace:: OEPlatform

.. meta::
   :keywords: OEAddLicenseFromHttp

.. oe:function:: OEAddLicenseFromHttp

   .. oe:language:: java

      .. oe:api:: java

         void OEAddLicenseFromHttp(java.net.URL url)

   .. oe:language:: python

      .. oe:api:: python

         OEAddLicenseFromHttp(url)

   .. oe:language:: csharp

      .. oe:api:: csharp

         void OEAddLicenseFromHttp(System.Uri uri)

   .. oe:language:: python java csharp

      License the current process with a license file retrieved from an
      HTTP or HTTPS request. The following caveats apply:

      - There is no proxy support.
      - The request has a 10 second time out.
      - Content-type must be any of the followings:
        ``text/plain``, ``text/html; charset=utf-8`` or ``text/plain; charset=utf-8``
      - An exception will be thrown if the server does not return status 200
        (success) with the contents of a valid ``oe_license.txt`` file.

      An example of setting the license:

      .. oe:source:: AddLicenseFromHttp.py
         :language: python
         :frag:     SNIPPET-addlicensefromhttp

      .. oe:source:: AddLicenseFromHttp.java
         :language: java
         :frag:     SNIPPET-addlicensefromhttp

      .. oe:source:: AddLicenseFromHttp.cs
         :language: csharp
         :frag:     SNIPPET-addlicensefromhttp

      .. seealso::

         An example of a python http license server is available
         here: https://github.com/oess/HttpLicenseServer

   .. oe:language:: c++

      This method is not available in C++.
