pub struct WebRequest { /* private fields */ }Expand description
Builder for web-style PHP requests.
Use the with_* methods to configure headers, cookies, body, and server
info, then call build() to create an ExecutionContext.
Implementations§
Source§impl WebRequest
impl WebRequest
pub fn new(method: Method) -> Self
pub fn get() -> Self
pub fn post() -> Self
pub fn put() -> Self
pub fn delete() -> Self
pub fn patch() -> Self
pub fn head() -> Self
pub fn options() -> Self
pub fn with_uri(self, uri: impl Into<String>) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
pub fn with_headers<I, K, V>(self, iter: I) -> Self
pub fn with_body(self, bytes: impl Into<Vec<u8>>) -> Self
pub fn with_content_type(self, ct: impl Into<String>) -> Self
pub fn with_server_name(self, name: impl Into<String>) -> Self
pub fn with_server_port(self, port: u16) -> Self
pub fn with_server_protocol(self, proto: impl Into<String>) -> Self
pub fn with_remote_addr(self, addr: impl Into<String>) -> Self
pub fn with_remote_port(self, port: u16) -> Self
pub fn with_server_addr(self, addr: impl Into<String>) -> Self
pub fn with_https(self, enabled: bool) -> Self
pub fn with_document_root(self, path: impl Into<PathBuf>) -> Self
pub fn with_path_info(self, path: impl Into<String>) -> Self
pub fn with_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_envs<I, K, V>(self, iter: I) -> Self
pub fn with_ini(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_ini_overrides<I, K, V>(self, iter: I) -> Self
pub fn build( self, script_path: impl AsRef<Path>, ) -> Result<ExecutionContext, WebRequestError>
Trait Implementations§
Source§impl Clone for WebRequest
impl Clone for WebRequest
Source§fn clone(&self) -> WebRequest
fn clone(&self) -> WebRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WebRequest
impl Debug for WebRequest
Source§impl Default for WebRequest
impl Default for WebRequest
Source§impl PhpSapiAdapter for WebRequest
impl PhpSapiAdapter for WebRequest
Source§fn build(
self,
script_path: impl AsRef<Path>,
) -> Result<ExecutionContext, AdapterError>
fn build( self, script_path: impl AsRef<Path>, ) -> Result<ExecutionContext, AdapterError>
Build an execution context from the configured adapter. Read more
Source§fn validate_script_path(
script_path: impl AsRef<Path>,
) -> Result<PathBuf, AdapterError>where
Self: Sized,
fn validate_script_path(
script_path: impl AsRef<Path>,
) -> Result<PathBuf, AdapterError>where
Self: Sized,
Validate that a script path exists and is accessible. Read more
Source§fn validate_non_empty(field_name: &str, value: &str) -> Result<(), AdapterError>where
Self: Sized,
fn validate_non_empty(field_name: &str, value: &str) -> Result<(), AdapterError>where
Self: Sized,
Validate a configuration field is not empty. Read more
Auto Trait Implementations§
impl Freeze for WebRequest
impl RefUnwindSafe for WebRequest
impl Send for WebRequest
impl Sync for WebRequest
impl Unpin for WebRequest
impl UnwindSafe for WebRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more