GNURLOPT_RTSP_REQUEST(3)
π NAME π
CURLOPT_RTSP_REQUEST β specify RTSP request. And yes bestie, you're in the gnurl section 3 manual, specifically the curl_easy_setopt options corner. π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RTSP_REQUEST, long request);
π DESCRIPTION π
okay so this is where you tell libcurl what kind of RTSP request to make. You pass one of the RTSP enum values below as a long in the request argument. Unless noted otherwise, commands require the Session ID to be initialized. π
CURL_RTSPREQ_OPTIONSβ grabs the available methods of the server. The application is responsible for parsing and obeying the response. The session ID is not needed for this method. no cap.CURL_RTSPREQ_DESCRIBEβ gets the low level description of a stream. The application should note what formats it understands in the'Accept:'header. Unless set manually, libcurl will automatically fill in'Accept: application/sdp'. Time-condition headers will be added to Describe requests if theCURLOPT_TIMECONDITION(3)option is active. (The session ID is not needed for this method.) π¦CURL_RTSPREQ_ANNOUNCEβ when sent by a client, this method changes the description of the session. For example, if a client is using the server to record a meeting, the client can use Announce to inform the server of all the meta-information about the session.ANNOUNCEacts like an HTTP PUT or POST just likeCURL_RTSPREQ_SET_PARAMETER. πCURL_RTSPREQ_SETUPβ Setup is used to initialize the transport layer for the session. The application must set the desired Transport options for a session by using theCURLOPT_RTSP_TRANSPORT(3)option prior to calling setup. If no session ID is currently set withCURLOPT_RTSP_SESSION_ID(3), libcurl will extract and use the session ID in the response to this request. The session ID is not needed for this method. π₯CURL_RTSPREQ_PLAYβ Send a Play command to the server. Use theCURLOPT_RANGE(3)option to modify the playback time (e.g.'npt=10-15'). βΆοΈCURL_RTSPREQ_PAUSEβ Send a Pause command to the server. Use theCURLOPT_RANGE(3)option with a single value to indicate when the stream should be halted. (e.g.npt='25'). βΈοΈCURL_RTSPREQ_TEARDOWNβ This command terminates an RTSP session. Simply closing a connection does not terminate the RTSP session since it is valid to control an RTSP session over different connections. πCURL_RTSPREQ_GET_PARAMETERβ Retrieve a parameter from the server. By default, libcurl will automatically include aContent-Type: text/parametersheader on all non-empty requests unless a custom one is set.GET_PARAMETERacts just like an HTTP PUT or POST (seeCURL_RTSPREQ_SET_PARAMETER). Applications wishing to send a heartbeat message (e.g. in the presence of a server-specified timeout) should send an emptyGET_PARAMETERrequest. π«ΆCURL_RTSPREQ_SET_PARAMETERβ Set a parameter on the server. By default, libcurl will automatically include aContent-Type: text/parametersheader unless a custom one is set. The interaction withSET_PARAMETERis much like an HTTP PUT or POST. An application may either useCURLOPT_UPLOAD(3)withCURLOPT_READDATA(3)like a HTTP PUT, or it may useCURLOPT_POSTFIELDS(3)like an HTTP POST. No chunked transfers are allowed, so the application must set theCURLOPT_INFILESIZE(3)in the former andCURLOPT_POSTFIELDSIZE(3)in the latter. Also, there is no use of multi-part POSTs within RTSP. π¨CURL_RTSPREQ_RECORDβ Used to tell the server to record a session. Use theCURLOPT_RANGE(3)option to modify the record time. βΊοΈCURL_RTSPREQ_RECEIVEβ This is a special request because it does not send any data to the server. The application may call this function in order to receive interleaved RTP data. It will return after processing one read buffer of data in order to give the application a chance to run. π
π¦ DEFAULT π¦
The DEFAULT section is empty on this page β nothing to see here, bestie. π
π PROTOCOLS π
RTSP β that's it, that's the protocol. Periodt. π
π EXAMPLE π
Here's the exact code from the page, no edits:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
/* ask for options! */
curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
β AVAILABILITY β
Added in 7.20.0. π
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Simple as that. π
π SEE ALSO π
(also the original has a trailing comma after the second one, so consider this your comma: , β iykyk π
)
π sign-off time: this page is from libcurl 7.37.0, dated 19 Jun 2014. Mwah! go slay your RTSP requests, bestie! π
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms