src/pds_doi_service/core/outputs/osti/osti_web_client.py
def submit_content(
        self, payload, url=None, username=None, password=None, method=WEB_METHOD_POST, content_type=CONTENT_TYPE_XML
    ):
        """
        Submits a payload to the OSTI DOI service via the POST action.

        The action taken by the service is determined by the contents of the
        payload.

        The OSTI endpoint URL and authentication credentials for the request
        are automatically pulled from the configuration file.

        Parameters
        ----------
        payload : str
            Payload to submit to the OSTI DOI service. Should correspond to
            an OSTI-format label file containing a single DOI record.
        url : str, optional
            The URL to submit the request to. If not submitted, it is pulled
            from the INI config OSTI url field.
        username : str, optional
            The username to authenticate the request as. If not submitted, it
            is pulled from the INI config OSTI user field.
        password : str, optional
            The password to authenticate the request with. If not submitted, it
            is pulled from the INI config OSTI password field.
        method : str, optional
            The HTTP method type to use with the request. Should be one of
            GET, POST, PUT or DELETE. Defaults to POST.
        content_type : str, optional
            The content type to specify the format of the payload, as well as
            the format of the response from OSTI. Currently, 'xml' and 'json'
            are supported. Defaults to xml.

        Returns
        -------
        doi : Doi
            Doi object parsed from the response label from OSTI.
        response_text : str
            Body of the response label from OSTI.

        """
        config = self._config_util.get_config()

        response_text = super()._submit_content(
            payload,
            url=url or config.get("OSTI", "url"),
            username=username or config.get("OSTI", "user"),
            password=password or config.get("OSTI", "password"),
            method=method,
            content_type=content_type,
        )

        # Re-use the parse functions from DOIOstiWebParser class to get the
        # list of Doi objects to return
        dois, _ = self._web_parser.parse_dois_from_label(response_text, content_type)

        return dois[0], response_text

        Submits a payload to the OSTI DOI service via the POST action.

        The action taken by the service is determined by the contents of the
        payload.

        The OSTI endpoint URL and authentication credentials for the request
        are automatically pulled from the configuration file.

        Parameters
        ----------
        payload : str
            Payload to submit to the OSTI DOI service. Should correspond to
            an OSTI-format label file containing a single DOI record.
        url : str, optional
            The URL to submit the request to. If not submitted, it is pulled
            from the INI config OSTI url field.
        username : str, optional
            The username to authenticate the request as. If not submitted, it
            is pulled from the INI config OSTI user field.
        password : str, optional
            The password to authenticate the request with. If not submitted, it
            is pulled from the INI config OSTI password field.
        method : str, optional
            The HTTP method type to use with the request. Should be one of
            GET, POST, PUT or DELETE. Defaults to POST.
        content_type : str, optional
            The content type to specify the format of the payload, as well as
            the format of the response from OSTI. Currently, 'xml' and 'json'
            are supported. Defaults to xml.

        Returns
        -------
        doi : Doi
            Doi object parsed from the response label from OSTI.
        response_text : str
            Body of the response label from OSTI.

        
Submits a payload to the OSTI DOI service via the POST action.
The action taken by the service is determined by the contents of the
payload.

The OSTI endpoint URL and authentication credentials for the request
are automatically pulled from the configuration file.

Parameters

payload : str
Payload to submit to the OSTI DOI service. Should correspond to
an OSTI-format label file containing a single DOI record.
url : str, optional
The URL to submit the request to. If not submitted, it is pulled
from the INI config OSTI url field.
username : str, optional
The username to authenticate the request as. If not submitted, it
is pulled from the INI config OSTI user field.
password : str, optional
The password to authenticate the request with. If not submitted, it
is pulled from the INI config OSTI password field.
method : str, optional
The HTTP method type to use with the request. Should be one of
GET, POST, PUT or DELETE. Defaults to POST.
content_type : str, optional
The content type to specify the format of the payload, as well as
the format of the response from OSTI. Currently, 'xml' and 'json'
are supported. Defaults to xml.

Returns

doi : Doi
Doi object parsed from the response label from OSTI.
response_text : str
Body of the response label from OSTI.
Submits a payload to the OSTI DOI service via the POST action . The action taken by the service is determined by the contents of the payload . The OSTI endpoint URL and authentication credentials for the request are automatically pulled from the configuration file . Parameters payload : str Payload to submit to the OSTI DOI service . Should correspond to an OSTI - format label file containing a single DOI record . url : str optional The URL to submit the request to . If not submitted it is pulled from the INI config OSTI url field . username : str optional The username to authenticate the request as . If not submitted it is pulled from the INI config OSTI user field . password : str optional The password to authenticate the request with . If not submitted it is pulled from the INI config OSTI password field . method : str optional The HTTP method type to use with the request . Should be one of GET POST PUT or DELETE . Defaults to POST . content_type : str optional The content type to specify the format of the payload as well as the format of the response from OSTI . Currently ' xml ' and ' json ' are supported . Defaults to xml . Returns doi : Doi Doi object parsed from the response label from OSTI . response_text : str Body of the response label from OSTI .
def submit_content(
        self, payload, url=None, username=None, password=None, method=WEB_METHOD_POST, content_type=CONTENT_TYPE_XML
    ):
        config = self._config_util.get_config()
        response_text = super()._submit_content(
            payload,
            url=url or config.get("OSTI", "url"),
            username=username or config.get("OSTI", "user"),
            password=password or config.get("OSTI", "password"),
            method=method,
            content_type=content_type,
        )
        dois, _ = self._web_parser.parse_dois_from_label(response_text, content_type)
        return dois[0], response_text
def submit_content ( self , payload , url = None , username = None , password = None , method = WEB_METHOD_POST , content_type = CONTENT_TYPE_XML ) : config = self . _config_util . get_config ( ) response_text = super ( ) . _submit_content ( payload , url = url or config . get ( "OSTI" , "url" ) , username = username or config . get ( "OSTI" , "user" ) , password = password or config . get ( "OSTI" , "password" ) , method = method , content_type = content_type , ) dois , _ = self . _web_parser . parse_dois_from_label ( response_text , content_type ) return dois [ 0 ] , response_text
Submits a payload to the OSTI DOI service via the POST action.
Submits a payload to the OSTI DOI service via the POST action .
"""
        Submits a payload to the OSTI DOI service via the POST action.

        The action taken by the service is determined by the contents of the
        payload.

        The OSTI endpoint URL and authentication credentials for the request
        are automatically pulled from the configuration file.

        Parameters
        ----------
        payload : str
            Payload to submit to the OSTI DOI service. Should correspond to
            an OSTI-format label file containing a single DOI record.
        url : str, optional
            The URL to submit the request to. If not submitted, it is pulled
            from the INI config OSTI url field.
        username : str, optional
            The username to authenticate the request as. If not submitted, it
            is pulled from the INI config OSTI user field.
        password : str, optional
            The password to authenticate the request with. If not submitted, it
            is pulled from the INI config OSTI password field.
        method : str, optional
            The HTTP method type to use with the request. Should be one of
            GET, POST, PUT or DELETE. Defaults to POST.
        content_type : str, optional
            The content type to specify the format of the payload, as well as
            the format of the response from OSTI. Currently, 'xml' and 'json'
            are supported. Defaults to xml.

        Returns
        -------
        doi : Doi
            Doi object parsed from the response label from OSTI.
        response_text : str
            Body of the response label from OSTI.

        """ # Re-use the parse functions from DOIOstiWebParser class to get the # list of Doi objects to return
self
payload
url
username
password
method
content_type