📄 htaccess.h
字号:
. Delete a Document (Method = DELETE).If you want to delete a document (or make the document inaccessible for futurereferences) then you can use the DELETE method in your request.( Delete a Document from Absolute URI)Request metainfomration about a document referencd by an absoluteURI.*/extern BOOL HTDeleteAbsolute (const char * url, HTRequest * request);/*( Delete a Document from Relative URI)Request metainformation about a document referenced by a relativeURI.*/extern BOOL HTDeleteRelative (const char * relative, HTParentAnchor * base, HTRequest * request);/*( Delete a Document using an Anchor)Here the URI is represented by an Anchor object.You can get an anchor object representing a URI by passing the URI to theapproproiate method in the Anchor class.*/extern BOOL HTDeleteAnchor (HTAnchor * anchor, HTRequest * request);/*. Save a Document ASIS From Memory (Method = PUT).If you already have a document in memory and it is associated with anAnchor object then you can PUT this documentto a remote server using the following methods. Other information that youcan set in the anchor is metadata like the media type, the document length,the language, or any other information that you want to associate with thedocument to be uploaded.This set of functions takes the document ASIS - that it theexact content of the document associated with this anchor will besent to the remote server. If your anchor represents a structured contentand the document itself is a parse tree, for example, then you can use thestructured PUT functions.If your application is an editor, then you may want to create a new anchoron the fly for temporary backups on local disk before you save it to a remoteserver. An easy way to get a new anchor with a local file URI is to use theHTTmpAnchor function which is part of theWWWApp interface.( Save a Document ASIS from Memory Using Absolute URI (PUT))The source is an anchor with the contents already in memory and the destinationis an absolute URI.*/extern BOOL HTPutAbsolute (HTParentAnchor * source, const char * destination, HTRequest * request);/*( Save a Document ASIS from Memory Using Relative URI (PUT))The source is an anchor with the contents already in memory and the destinationis a relative URI relative to the destination anchor*/extern BOOL HTPutRelative (HTParentAnchor * source, const char * relative, HTParentAnchor * destination_base, HTRequest * request);/*( Save a Document ASIS from Memory Using an Anchor (PUT))Both the source and the anchor are anchor objects. The source anchor alreadyhas the contents in memory*/extern BOOL HTPutAnchor (HTParentAnchor * source, HTAnchor * dest, HTRequest * request);/*. Save a Structured Document (Using PUT).If you want to save a document from memory but it contains structured information(for example, it is in the form of a parse tree) then you can use this interface.The only difference from above is that the caller must provide the functionthat provides data while sending it accross the network - we can't just takeit as a block. You can for example have a look at theHTEntity_callback function which is used in theASIS interface if you want to write your owndata feeding method.( Save a Structured Document from Memory to Absolute URI (PUT))Upload a document referenced by an absolute URI.*/extern BOOL HTPutStructuredAbsolute (HTParentAnchor * source, const char * destination, HTRequest * request, HTPostCallback * input);/*( Save a Structured Document from Memory to Relative URI (PUT))The source is an anchor with the contents already in memory and the destinationis a relative URI relative to the destination anchor*/extern BOOL HTPutStructuredRelative (HTParentAnchor * source, const char * relative, HTParentAnchor * destination_base, HTRequest * request, HTPostCallback * input);/*( Save a Structured Document Using an Anchor and the PUT Method)The source is an anchor with the contents already in memory and the destinationis a relative URI. The HTPostCallback function type is declared in the HTRequestobject.*/extern BOOL HTPutStructuredAnchor (HTParentAnchor * source, HTAnchor * destination, HTRequest * request, HTPostCallback * input);/*. Save a Remote Document (Using PUT).If the content of the document associated with the anchor is NOT inmemory then you can use this interface. These methods make two requests:first they go out and get the source which can be on an FTP server, on localdisk, on another HTTP server etc. and then they PUT this document ASIS tothe destination HTTP server.( Save a Document from Absolute URI using PUT)Get the source and PUT it to the destination which is an absolute URI*/extern BOOL HTPutDocumentAbsolute (HTParentAnchor * source, const char * destination, HTRequest * request);/*( Save a Document from Relative URI using PUT)Get the source and PUT it to the destination which is a relative URI*/extern BOOL HTPutDocumentRelative (HTParentAnchor * source, const char * relative, HTParentAnchor * destination_base, HTRequest * request);/*( Save a Document Using an Anchor and the PUT Method)Get the source and PUT it to the destination which is an anchor object.*/extern BOOL HTPutDocumentAnchor (HTParentAnchor * source, HTAnchor * destination, HTRequest * request);/*. Post a Document from Memory ASIS (Method = POST).If you already have a document in memory and it is associated with anAnchor object then you can POST this documentto a remote server using the following methods. Other information that youcan set in the anchor is metadata like the media type, the document length,the language, or any other information that you want to associate with thedocument to be uploaded.This set of functions takes the document ASIS - that it theexact content of the document associated with this anchor will besent to the remote server.If your application is an editor, then you may want to create a new anchoron the fly for temporary backups on local disk before you save it to a remoteserver. An easy way to get a new anchor with a local file URI is to use theHTTmpAnchor function which is part of theWWWApp interface.( Post a Document from Memory ASIS using Absolute URI (POST))Upload a document using POST referenced by an absolute URI.*/extern BOOL HTPostAbsolute (HTParentAnchor * source, const char * destination, HTRequest * request);/*( Post a Document from Memory ASIS using Relative URI (POST))Upload a document using POST referenced by a relative URI.*/extern BOOL HTPostRelative (HTParentAnchor * source, const char * relative, HTParentAnchor * destination_base, HTRequest * request);/*( Post a Document from Memory ASIS using an Anchor (POST))POST an anchor - here both the source and the anchor are anchor objects.The source anchor already has the contents in memory.*/extern BOOL HTPostAnchor (HTParentAnchor * source, HTAnchor * dest, HTRequest * request);/*. Get Available Options for a Document (Method = OPTIONS).If you want to get information about a document then you can use the theOPTIONS method in your request. The OPTIONS methodrepresents a request for information about the communication options availableon the request/response chain identified by the Request-URI.This method allows the client to determine the options and/or requirementsassociated with a resource, or the capabilities of a server, without implyinga resource action or initiating a resource retrieval.A speciality about the OPTIONS method is that the client canissue a request with no pathinfo at all but only with a "*".That is, the request line can look like this "OPTIONS * HTTP/1.1".This means that we request information about the server as a whole and notonly about a single URI. You can get this effect by using a URI containingthe hostname alone with NO extra slash at the end, for examplehttp://www.w3.org, http://www.cern.ch.( Options Available for Document from Absolute URI)Request options about a document referencd by an absolute URI.*/extern BOOL HTOptionsAbsolute (const char * url, HTRequest * request);/*( Options Available for Document from Relative URI)Request options about a document referenced by a relative URI.*/extern BOOL HTOptionsRelative (const char * relative, HTParentAnchor * base, HTRequest * request);/*( Options Available for Document using an Anchor)Here the URI is represented by an Anchor object.You can get an anchor object representing a URI by passing the URI to theappropriate method in the Anchor class.*/extern BOOL HTOptionsAnchor (HTAnchor * anchor, HTRequest * request);/*. Get Trace Loop back Information for a Document (Method = TRACE).The TRACE method is used to invoke a remote, application-layer loop-backof the request message. The final recipient of the request SHOULD reflectthe message received back to the client as the entity-body of a 200 (OK)response. The final recipient is either the origin server or the first proxyor gateway to receive a Max-Forwards value of zero (0) in the request (seesection 14.31). A TRACE request MUST NOT include an entity.TRACE allows the client to see what is being received at the other end ofthe request chain and use that data for testing or diagnostic information.The value of the Via header field (section 14.44) is of particular interest,since it acts as a trace of the request chain. Use of the Max-Forwards headerfield allows the client to limit the length of the request chain, which isuseful for testing a chain of proxies forwarding messages in an infiniteloop.If successful, the response SHOULD contain the entire request message inthe entity-body, with a Content-Type of "message/http". Responsesto this method MUST NOT be cached.( Traces Available for Document from Absolute URI)Request traces about a document referencd by an absolute URI.*/extern BOOL HTTraceAbsolute (const char * url, HTRequest * request);/*( Traces Available for Document from Relative URI)Request traces about a document referenced by a relative URI.*/extern BOOL HTTraceRelative (const char * relative, HTParentAnchor * base, HTRequest * request);/*( Traces Available for Document using an Anchor)Here the URI is represented by an Anchor object.You can get an anchor object representing a URI by passing the URI to theappropriate method in the Anchor class.*/extern BOOL HTTraceAnchor (HTAnchor * anchor, HTRequest * request);/*. Serve a Request.Although libwww is primarily for clients, it is in fact symmetric in thatit can handle both client requests and server requests. The way this is handledis that each protocol is registered with both aclient handler and a server handler - depending on which type of requestyou use, one of them is called. Note that in order to be able to serve anydocument, there actually have to be a server handler. However, libwww onlycomes with a raw socket loader which isn't muchof a server. There is an attempt of an HTTP serverbut it is not completeThe protocol handler used to serve the request is determined by the URI -just as for client side requests. That is, libwww can in fact simultaneouslybe the server for multiple protocols if you really want to. Examples of URIsthat you can use are noop://localhost:8888 which means that libwwwstarts listening on port 8888 (see the listenexample for details). Other examples are http://localhost:7777which means that it listens for HTTP on port 7777. Again, there is no HTTPserver in libwww - this is just an example.*/extern BOOL HTServeAbsolute (const char * address, HTRequest * request);/*. Save a URI To Multiple Destinations - Not supported!!!.Note: This is no longer supportedThese are the generic versions of the PUT and POSTfunctions. They can be used to send documents to multiple destinationssimultanously using the PostWeb model.( Copy an anchor - not supported)Fetch the URI from either local file store or from a remote HTTP serverand send it using either PUT or POST to the remote destination using HTTP.The caller can decide the exact method used and which HTTP header fieldsto transmit by setting the user fields in the request structure. If postingto NNTP then we can't dispatch at this level but must pass the source anchorto the news module that then takes all the refs to NNTP and puts into the"newsgroups" header Returns YES if request accepted, else NO*/extern BOOL HTCopyAnchor (HTAnchor * src_anchor, HTRequest * main_req);/*( Upload an Anchor - not supported)This function can be used to send data along with a request to a remote server.It can for example be used to POST form data to a remote HTTP server - orit can be used to post a newsletter to a NNTP server. In either case, youpass a callback function which the request calls when the remote destinationis ready to accept data. In this callback you get the current request objectand a stream into where you can write data. It is very important that youreturn the value returned by this stream to the Library so that it knowswhat to do next. The reason is that the outgoing stream might block or anerror may occur and in that case the Library must know about it. If you donot want to handle the stream interface yourself then you can use theHTUpload_callback which is declared below. The source anchorrepresents the data object in memory and it points to the destination anchorby using the POSTWeb method.The source anchor contains metainformation about the data object in memoryand the destination anchor represents the reponse from the remote server.Returns YES if request accepted, else NO*/extern BOOL HTUploadAnchor (HTAnchor * source_anchor, HTRequest * request, HTPostCallback * callback);/*( POST Callback Handler - not supported)Is you do not want to handle the stream interface on your own, you can usethis "middleman" function which does the actual writing to the target streamfor the anchor upload and also handles the return value from the stream.Now, your application is called via the callback function that you may associatewith a request object. You indicate when you have sent all the data you wantby returning HT_LOADED from the callback.*/extern int HTUpload_callback (HTRequest * request, HTStream * target);/**/#endif /* HTACCESS_H *//* @(#) $Id: HTAccess.html,v 2.89 1998/12/17 01:51:01 frystyk Exp $*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -