Differences From Artifact [637136b15a]:
- File src/OFHTTPClient.h — part of check-in [7e5c81e186] at 2018-01-03 19:49:46 on branch trunk — Update copyright notice (user: js, size: 6850) [annotate] [blame] [check-ins using]
To Artifact [e93ee6e64d]:
- File
src/OFHTTPClient.h
— part of check-in
[8681bba25e]
at
2018-02-18 00:20:39
on branch trunk
— OFHTTPClient: Add a callback for the request body
This is in preparation for removing the body from OFHTTPRequest.
Having it as OFData that is part of the OFHTTPRequest was a bad idea, as
it does not allow streaming. (user: js, size: 7417) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
23 24 25 26 27 28 29 30 31 32 33 34 35 36 | OF_ASSUME_NONNULL_BEGIN @class OFDictionary OF_GENERIC(KeyType, ObjectType); @class OFHTTPClient; @class OFHTTPRequest; @class OFHTTPResponse; @class OFTCPSocket; @class OFURL; /*! * @protocol OFHTTPClientDelegate OFHTTPClient.h ObjFW/OFHTTPClient.h * * @brief A delegate for OFHTTPClient. | > | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | OF_ASSUME_NONNULL_BEGIN @class OFDictionary OF_GENERIC(KeyType, ObjectType); @class OFHTTPClient; @class OFHTTPRequest; @class OFHTTPResponse; @class OFStream; @class OFTCPSocket; @class OFURL; /*! * @protocol OFHTTPClientDelegate OFHTTPClient.h ObjFW/OFHTTPClient.h * * @brief A delegate for OFHTTPClient. |
︙ | ︙ | |||
58 59 60 61 62 63 64 | * @param exception The exception the client encountered * @param request The request during which the client encountered the exception * @param context The context object that was passed to * @ref asyncPerformRequest:context: */ - (void)client: (OFHTTPClient *)client didEncounterException: (id)exception | | | > > > > > > > > > > > > > > > | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | * @param exception The exception the client encountered * @param request The request during which the client encountered the exception * @param context The context object that was passed to * @ref asyncPerformRequest:context: */ - (void)client: (OFHTTPClient *)client didEncounterException: (id)exception request: (OFHTTPRequest *)request context: (nullable id)context; @optional /*! * @brief A callback which is called when an OFHTTPClient creates a socket. * * This is useful if the connection is using HTTPS and the server requires a * client certificate. This callback can then be used to tell the TLS socket * about the certificate. Another use case is to tell the socket about a SOCKS5 * proxy it should use for this connection. * * @param client The OFHTTPClient that created a socket * @param socket The socket created by the OFHTTPClient * @param request The request for which the socket was created * @param context The context object that was passed to * @ref asyncPerformRequest:context: */ - (void)client: (OFHTTPClient *)client didCreateSocket: (OF_KINDOF(OFTCPSocket *))socket request: (OFHTTPRequest *)request context: (nullable id)context; /*! * @brief A callback which is called when an OFHTTPClient wants to send the * body for a request. * * @param client The OFHTTPClient that wants to send the body * @param body A stream into which the body should be written * @param request The request for which the OFHTTPClient wants to send the body * @param context The context object that was passed to * @ref asyncPerformRequest:context: */ - (void)client: (OFHTTPClient *)client requestsBody: (OFStream *)body request: (OFHTTPRequest *)request context: (nullable id)context; /*! * @brief A callback which is called when an OFHTTPClient received headers. * * @param client The OFHTTPClient which received the headers * @param headers The headers received * @param statusCode The status code received * @param request The request for which the headers and status code have been |
︙ | ︙ |