add request->redirect(url)
This commit is contained in:
parent
b5ba7f542c
commit
e5a6999582
|
@ -195,6 +195,8 @@ class AsyncWebServerRequest {
|
|||
void setHandler(AsyncWebHandler *handler){ _handler = handler; }
|
||||
void addInterestingHeader(String name);
|
||||
|
||||
void redirect(String url);
|
||||
|
||||
void send(AsyncWebServerResponse *response);
|
||||
void send(int code, String contentType=String(), String content=String());
|
||||
void send(FS &fs, String path, String contentType=String(), bool download=false);
|
||||
|
|
|
@ -694,6 +694,12 @@ void AsyncWebServerRequest::sendChunked(String contentType, AwsResponseFiller ca
|
|||
send(beginChunkedResponse(contentType, callback));
|
||||
}
|
||||
|
||||
void AsyncWebServerRequest::redirect(String url){
|
||||
AsyncWebServerResponse * response = beginResponse(302);
|
||||
response->addHeader("Location",url);
|
||||
send(response);
|
||||
}
|
||||
|
||||
|
||||
bool AsyncWebServerRequest::authenticate(const char * username, const char * password){
|
||||
if(_authorization.length()){
|
||||
|
|
Loading…
Reference in New Issue