From: Seonah Moon Date: Tue, 14 Jun 2016 12:03:59 +0000 (+0900) Subject: Fixed doxygen comments X-Git-Tag: submit/tizen/20160617.081742~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F74536%2F5;p=platform%2Fcore%2Fapi%2Fhttp.git Fixed doxygen comments Change-Id: Iab5600653586a8bc26e8d580100f954a6039298a Signed-off-by: Seonah Moon --- diff --git a/doc/http_doc.h b/doc/http_doc.h index 557c2ad..5331e00 100755 --- a/doc/http_doc.h +++ b/doc/http_doc.h @@ -19,9 +19,9 @@ #define __TIZEN_NETWORK_HTTP_DOC_H__ /** - * @ingroup CAPI_NETWORK_FRAMEWORK * @defgroup CAPI_NETWORK_HTTP_MODULE HTTP * @brief The HTTP API provides functions for communication with server according to HTTP protocol. + * @ingroup CAPI_NETWORK_FRAMEWORK * * @section CAPI_NETWORK_HTTP_MODULE_HEADER Required Header * \#include @@ -39,20 +39,17 @@ * - http://tizen.org/feature/network.internet \n * * It is recommended to design feature related codes in your application for reliability.\n - * * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n - * * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n - * * More details on featuring your application can be found from Feature List. - * @ endif * + * @endif */ /** - * @ingroup CAPI_NETWORK_HTTP_MODULE * @defgroup CAPI_NETWORK_HTTP_SESSION_MODULE HTTP Session * @brief The HTTP Session API provides functions for managing HTTP session. + * @ingroup CAPI_NETWORK_HTTP_MODULE * * @section CAPI_NETWORK_HTTP_SESSION_MODULE_HEADER Required Header * \#include @@ -70,20 +67,16 @@ * - http://tizen.org/feature/network.internet \n * * It is recommended to design feature related codes in your application for reliability.\n - * * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n - * * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n - * * More details on featuring your application can be found from Feature List. - * @ endif - * + * @endif */ /** - * @ingroup CAPI_NETWORK_HTTP_SESSION_MODULE * @defgroup CAPI_NETWORK_HTTP_TRANSACTION_MODULE HTTP Transaction * @brief The HTTP Transaction API provides functions for managing HTTP transactions. + * @ingroup CAPI_NETWORK_HTTP_SESSION_MODULE * * @section CAPI_NETWORK_HTTP_TRANSACTION_MODULE_HEADER Required Header * \#include @@ -102,20 +95,16 @@ * - http://tizen.org/feature/network.internet \n * * It is recommended to design feature related codes in your application for reliability.\n - * * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n - * * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n - * * More details on featuring your application can be found from Feature List. - * @ endif - * + * @endif */ /** - * @ingroup CAPI_NETWORK_HTTP_TRANSACTION_MODULE * @defgroup CAPI_NETWORK_HTTP_REQUEST_MODULE HTTP Request * @brief It manages HTTP request. + * @ingroup CAPI_NETWORK_HTTP_TRANSACTION_MODULE * * @section CAPI_NETWORK_HTTP_REQUEST_MODULE_HEADER Required Header * \#include @@ -132,20 +121,16 @@ * - http://tizen.org/feature/network.internet\n * * It is recommended to design feature related codes in your application for reliability.\n - * * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n - * * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n - * * More details on featuring your application can be found from Feature List. - * @ endif - * + * @endif */ /** - * @ingroup CAPI_NETWORK_HTTP_TRANSACTION_MODULE * @defgroup CAPI_NETWORK_HTTP_RESPONSE_MODULE HTTP Response * @brief It manages HTTP response. + * @ingroup CAPI_NETWORK_HTTP_TRANSACTION_MODULE * * @section CAPI_NETWORK_HTTP_RESPONSE_MODULE_HEADER Required Header * \#include @@ -160,20 +145,16 @@ * - http://tizen.org/feature/network.internet \n * * It is recommended to design feature related codes in your application for reliability.\n - * * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n - * * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n - * * More details on featuring your application can be found from Feature List. - * @ endif - * + * @endif */ /** - * @ingroup CAPI_NETWORK_HTTP_TRANSACTION_MODULE * @defgroup CAPI_NETWORK_HTTP_HEADER_MODULE HTTP Header * @brief It manages custom header + * @ingroup CAPI_NETWORK_HTTP_TRANSACTION_MODULE * * @section CAPI_NETWORK_HTTP_HEADER_MODULE_HEADER Required Header * \#include @@ -187,14 +168,33 @@ * - http://tizen.org/feature/network.internet \n * * It is recommended to design feature related codes in your application for reliability.\n - * * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n - * * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n - * * More details on featuring your application can be found from Feature List. - * @ endif + * @endif + */ + +/** + * @defgroup CAPI_NETWORK_HTTP_AUTHENTICATION_MODULE HTTP Authentication + * @brief It manages HTTP Autehntication and credential + * @ingroup CAPI_NETWORK_HTTP_TRANSACTION_MODULE * + * @section CAPI_NETWORK_HTTP_AUTHENTICATION_MODULE_HEADER Required Header + * \#include + * + * @section CAPI_NETWORK_HTTP_AUTHENTICATION_MODULE_OVERVIEW Overview + * It manages HTTP Autehntication and credential + * + * @if WEARABLE + * @section CAPI_NETWORK_HTTP_HEADER_MODULE_FEATURE Related Features + * This API is related with the following features:\n + * - http://tizen.org/feature/network.internet \n + * + * It is recommended to design feature related codes in your application for reliability.\n + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * More details on featuring your application can be found from Feature List. + * @endif */ #endif /* __TIZEN_NETWORK_HTTP_DOC_H__ */ diff --git a/include/http.h b/include/http.h index afd604b..2e2a137 100644 --- a/include/http.h +++ b/include/http.h @@ -403,7 +403,7 @@ int http_session_get_max_transaction_count(http_session_h http_session, int *tra * @retval #HTTP_ERROR_NONE Successful * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter * @retval #HTTP_ERROR_INVALID_OPERATION Invalid operation - * @retval #HTTP_ERROR_OPERATION_fAILED Operation failed + * @retval #HTTP_ERROR_OPERATION_FAILED Operation failed * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported */ int http_session_destroy_all_transactions(http_session_h http_session); @@ -420,7 +420,8 @@ int http_session_destroy_all_transactions(http_session_h http_session); * @brief Submits the HTTP request. * @since_tizen 3.0 * @privlevel public - * @privilege %http://tizen.org/privilege/internet + * @privilege %http://tizen.org/privilege/internet \n + * %http://tizen.org/privilege/network.get * @param[in] http_transaction The http transaction handle * @return 0 on success, otherwise negative error value * @retval #HTTP_ERROR_NONE Successful @@ -514,7 +515,7 @@ int http_transaction_set_completed_cb(http_transaction_h http_transaction, http_ * @retval #HTTP_ERROR_INVALID_OPERATION Invalid operation * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported */ -int http_transaction_set_aborted_cb(http_transaction_h http_http_transaction, http_transaction_aborted_cb aborted_cb, void* user_data); +int http_transaction_set_aborted_cb(http_transaction_h http_transaction, http_transaction_aborted_cb aborted_cb, void* user_data); /** * @brief Registers the progress callbacks. @@ -653,6 +654,15 @@ int http_transaction_set_server_certificate_verification(http_transaction_h http */ int http_transaction_get_server_certificate_verification(http_transaction_h http_transaction, bool* verify); +/** + * @} + */ + +/** + * @addtogroup CAPI_NETWORK_HTTP_HEADER_MODULE + * @{ + */ + /** * @brief Adds a named field to header. * @details Adds a named field, which is a <@c fieldName, @c fieldValue> pair, to the current instance of HTTP Transaction. @@ -698,94 +708,9 @@ int http_transaction_header_remove_field(http_transaction_h http_transaction, co int http_transaction_header_get_field_value(http_transaction_h http_transaction, const char *field_name, char **field_value); /** - * @brief Opens HTTP transaction with authentication information. - * @since_tizen 3.0 - * @remarks The @a http_auth_transaction should be released using http_transaction_destroy(). - * @param[in] http_transaction The http transaction handle - * @param[out] http_auth_transaction The http transaction handle - * @return 0 on success, otherwise negative error value - * @retval #HTTP_ERROR_NONE Successful - * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #HTTP_ERROR_INVALID_OPERATION Invalid operation - * @retval #HTTP_ERROR_OUT_OF_MEMORY Out of memory - * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported - */ -int http_open_authentication(http_transaction_h http_transaction, http_transaction_h *http_auth_transaction); - -/** - * @brief Sets an HTTP credentials. - * @details Set an HTTP authentication scheme such as username and password. - * @since_tizen 3.0 - * @param[in] http_transaction The http transaction handle - * @param[in] user_name The http user name - * @param[in] password The http password - * @return 0 on success, otherwise negative error value - * @retval #HTTP_ERROR_NONE Successful - * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported - */ -int http_transaction_set_credentials(http_transaction_h http_transaction, const char *user_name, const char *password); - -/** - * @brief Gets the username & password for the http credential. - * @since_tizen 3.0 - * @remarks The @a user_name & @a password should be freed using free(). - * @param[in] http_transaction The http transaction handle - * @param[out] user_name The http credential user name - * @param[out] password The http credential password - * @return 0 on success, otherwise negative error value - * @retval #HTTP_ERROR_NONE Successful - * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #HTTP_ERROR_INVALID_OPERATION Invalid operation - * @retval #HTTP_ERROR_OUT_OF_MEMORY Out of memory - * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported - */ -int http_transaction_get_credentials(http_transaction_h http_transaction, char **user_name, char **password); - -/** - * @brief Sets an HTTP authentication scheme. - * @details Set an HTTP authentication scheme such as BASIC, MD5, NTLM and etc. - * @since_tizen 3.0 - * @param[in] http_transaction The http transaction handle - * @param[in] auth_scheme The http authentication scheme - * @return 0 on success, otherwise negative error value - * @retval #HTTP_ERROR_NONE Successful - * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported - */ -int http_transaction_set_http_auth_scheme(http_transaction_h http_transaction, http_auth_scheme_e auth_scheme); - -/** - * @brief Gets the HTTP authentication scheme. - * @since_tizen 3.0 - * @param[in] http_transaction The http transaction handle - * @param[out] auth_scheme The http auth scheme value - * @return 0 on success, otherwise negative error value - * @retval #HTTP_ERROR_NONE Successful - * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #HTTP_ERROR_INVALID_OPERATION Invalid operation - * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported - */ -int http_transaction_get_http_auth_scheme(http_transaction_h http_transaction, http_auth_scheme_e *auth_scheme); - -/** - * @brief Gets the HTTP authentication realm. - * @since_tizen 3.0 - * @remarks The @a realm should be freed using free(). - * @param[in] http_transaction The http transaction handle - * @param[out] realm The http realm value - * @return 0 on success, otherwise negative error value - * @retval #HTTP_ERROR_NONE Successful - * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #HTTP_ERROR_INVALID_OPERATION Invalid operation - * @retval #HTTP_ERROR_OUT_OF_MEMORY Out of memory - * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported - */ -int http_transaction_get_realm(http_transaction_h http_transaction, char **realm); + * @} + */ -/** - * @} - */ /** * @addtogroup CAPI_NETWORK_HTTP_REQUEST_MODULE @@ -998,6 +923,101 @@ int http_transaction_response_get_status_text(http_transaction_h http_transactio */ int http_transaction_response_get_version(http_transaction_h http_transaction, http_version_e *version); +/** + * @} + */ + +/** + * @addtogroup CAPI_NETWORK_HTTP_AUTHENTICATION_MODULE + * @{ + */ + +/** + * @brief Opens HTTP transaction with authentication information. + * @since_tizen 3.0 + * @remarks The @a http_auth_transaction should be released using http_transaction_destroy(). + * @param[in] http_transaction The http transaction handle + * @param[out] http_auth_transaction The http transaction handle + * @return 0 on success, otherwise negative error value + * @retval #HTTP_ERROR_NONE Successful + * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #HTTP_ERROR_INVALID_OPERATION Invalid operation + * @retval #HTTP_ERROR_OUT_OF_MEMORY Out of memory + * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported + */ +int http_transaction_open_authentication(http_transaction_h http_transaction, http_transaction_h *http_auth_transaction); + +/** + * @brief Sets an HTTP credentials. + * @details Set an HTTP authentication scheme such as username and password. + * @since_tizen 3.0 + * @param[in] http_transaction The http transaction handle + * @param[in] user_name The http user name + * @param[in] password The http password + * @return 0 on success, otherwise negative error value + * @retval #HTTP_ERROR_NONE Successful + * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported + */ +int http_transaction_set_credentials(http_transaction_h http_transaction, const char *user_name, const char *password); + +/** + * @brief Gets the username & password for the http credential. + * @since_tizen 3.0 + * @remarks The @a user_name & @a password should be freed using free(). + * @param[in] http_transaction The http transaction handle + * @param[out] user_name The http credential user name + * @param[out] password The http credential password + * @return 0 on success, otherwise negative error value + * @retval #HTTP_ERROR_NONE Successful + * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #HTTP_ERROR_INVALID_OPERATION Invalid operation + * @retval #HTTP_ERROR_OUT_OF_MEMORY Out of memory + * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported + */ +int http_transaction_get_credentials(http_transaction_h http_transaction, char **user_name, char **password); + +/** + * @brief Sets an HTTP authentication scheme. + * @details Set an HTTP authentication scheme such as BASIC, MD5, NTLM and etc. + * @since_tizen 3.0 + * @param[in] http_transaction The http transaction handle + * @param[in] auth_scheme The http authentication scheme + * @return 0 on success, otherwise negative error value + * @retval #HTTP_ERROR_NONE Successful + * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported + */ +int http_transaction_set_http_auth_scheme(http_transaction_h http_transaction, http_auth_scheme_e auth_scheme); + +/** + * @brief Gets the HTTP authentication scheme. + * @since_tizen 3.0 + * @param[in] http_transaction The http transaction handle + * @param[out] auth_scheme The http auth scheme value + * @return 0 on success, otherwise negative error value + * @retval #HTTP_ERROR_NONE Successful + * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #HTTP_ERROR_INVALID_OPERATION Invalid operation + * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported + */ +int http_transaction_get_http_auth_scheme(http_transaction_h http_transaction, http_auth_scheme_e *auth_scheme); + +/** + * @brief Gets the HTTP authentication realm. + * @since_tizen 3.0 + * @remarks The @a realm should be freed using free(). + * @param[in] http_transaction The http transaction handle + * @param[out] realm The http realm value + * @return 0 on success, otherwise negative error value + * @retval #HTTP_ERROR_NONE Successful + * @retval #HTTP_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #HTTP_ERROR_INVALID_OPERATION Invalid operation + * @retval #HTTP_ERROR_OUT_OF_MEMORY Out of memory + * @retval #HTTP_ERROR_NOT_SUPPORTED Not Supported + */ +int http_transaction_get_realm(http_transaction_h http_transaction, char **realm); + /** * @} */ diff --git a/src/http_transaction.c b/src/http_transaction.c index b1962bd..e5323c7 100644 --- a/src/http_transaction.c +++ b/src/http_transaction.c @@ -941,6 +941,9 @@ API int http_transaction_get_realm(http_transaction_h http_transaction, char **r __http_transaction_h *transaction = (__http_transaction_h *)http_transaction; + if (transaction->realm == NULL) + return HTTP_ERROR_INVALID_OPERATION; + *realm = g_strdup(transaction->realm); if (*realm == NULL) { ERR("strdup is failed\n"); @@ -992,7 +995,7 @@ API int http_transaction_get_credentials(http_transaction_h http_transaction, ch return HTTP_ERROR_NONE; } -API int http_open_authentication(http_transaction_h http_transaction, http_transaction_h *http_auth_transaction) +API int http_transaction_open_authentication(http_transaction_h http_transaction, http_transaction_h *http_auth_transaction) { _retvm_if(http_transaction == NULL, HTTP_ERROR_INVALID_PARAMETER, "parameter(http_transaction) is NULL\n"); diff --git a/test/http_test.c b/test/http_test.c index e064d07..738d6dc 100644 --- a/test/http_test.c +++ b/test/http_test.c @@ -69,7 +69,7 @@ void __transaction_completed_cb(http_transaction_h transaction, void *user_data) http_transaction_h http_auth_transaction; http_auth_scheme_e auth_scheme = HTTP_AUTH_NONE; - http_open_authentication(transaction, &http_auth_transaction); + http_transaction_open_authentication(transaction, &http_auth_transaction); http_transaction_get_http_auth_scheme(http_auth_transaction, &auth_scheme); printf("User ID: ");