X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=include%2Fyaz%2Furl.h;h=0c4a1f43d2d0f559cb80c05b9018a54ddbbe9138;hp=899a580466f6d4eeebac4efe4238fae709e89d73;hb=d0da7ea31871b3fcb3785ec7e1d06f4739fb6ada;hpb=5242cb5a8634bfa38b9333ff7f903e718ac6e292 diff --git a/include/yaz/url.h b/include/yaz/url.h index 899a580..0c4a1f4 100644 --- a/include/yaz/url.h +++ b/include/yaz/url.h @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2012 Index Data. + * Copyright (C) Index Data. * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -60,6 +60,18 @@ YAZ_EXPORT void yaz_url_destroy(yaz_url_t p); */ YAZ_EXPORT void yaz_url_set_proxy(yaz_url_t p, const char *proxy); +/** \brief sets maximum number of redirects + \param p handle + \param num maximum number of redirects +*/ +YAZ_EXPORT void yaz_url_set_max_redirects(yaz_url_t p, int num); + +/** \brief sets verbose level 0=none, >0 verbose + \param p handle + \param num verbose level +*/ +YAZ_EXPORT void yaz_url_set_verbose(yaz_url_t p, int num); + /** \brief executes the actual HTTP request (including redirects, etc) \param p handle \param uri URL @@ -68,11 +80,20 @@ YAZ_EXPORT void yaz_url_set_proxy(yaz_url_t p, const char *proxy); \param buf content buffer for HTTP request, NULL for empty content \param len content length for HTTP request \returns HTTP response; NULL on ERROR. + + Use yaz_url_get_error to get details if NULL is returned. */ YAZ_EXPORT Z_HTTP_Response *yaz_url_exec(yaz_url_t p, const char *uri, const char *method, Z_HTTP_Header *headers, const char *buf, size_t len); + +/** \brief get last error from yaz_url_exec + \param p handle + \returns message (possibly empty string no error occurred) +*/ +YAZ_EXPORT const char *yaz_url_get_error(yaz_url_t p); + YAZ_END_CDECL #endif