All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openqa.selenium.devtools.network.model.WebSocketRequest Maven / Gradle / Ivy

Go to download

Selenium automates browsers. That's it! What you do with that power is entirely up to you.

There is a newer version: 4.0.0-rc-1
Show newest version
package org.openqa.selenium.devtools.network.model;

import org.openqa.selenium.Beta;
import org.openqa.selenium.json.JsonInput;

/**
 * WebSocket request data.
 */
public class WebSocketRequest {

    private final org.openqa.selenium.devtools.network.model.Headers headers;

    public WebSocketRequest(org.openqa.selenium.devtools.network.model.Headers headers) {
        this.headers = java.util.Objects.requireNonNull(headers, "headers is required");
    }

    /**
     * HTTP request headers.
     */
    public org.openqa.selenium.devtools.network.model.Headers getHeaders() {
        return headers;
    }

    private static WebSocketRequest fromJson(JsonInput input) {
        org.openqa.selenium.devtools.network.model.Headers headers = null;
        input.beginObject();
        while (input.hasNext()) {
            switch(input.nextName()) {
                case "headers":
                    headers = input.read(org.openqa.selenium.devtools.network.model.Headers.class);
                    break;
                default:
                    input.skipValue();
                    break;
            }
        }
        input.endObject();
        return new WebSocketRequest(headers);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy