WebPubSubServiceClient.SendToGroup Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Sobrecargas
SendToGroup(String, String, ContentType) |
Enviar un mensaje a un grupo de conexiones. |
SendToGroup(String, RequestContent, ContentType, IEnumerable<String>, RequestContext) |
Enviar contenido dentro del cuerpo de la solicitud a un grupo de conexiones. |
SendToGroup(String, RequestContent, ContentType, IEnumerable<String>, String, RequestContext) |
Enviar contenido dentro del cuerpo de la solicitud a un grupo de conexiones. |
SendToGroup(String, String, ContentType)
Enviar un mensaje a un grupo de conexiones.
public virtual Azure.Response SendToGroup (string group, string content, Azure.Core.ContentType contentType = default);
abstract member SendToGroup : string * string * Azure.Core.ContentType -> Azure.Response
override this.SendToGroup : string * string * Azure.Core.ContentType -> Azure.Response
Public Overridable Function SendToGroup (group As String, content As String, Optional contentType As ContentType = Nothing) As Response
Parámetros
- group
- String
Nombre del grupo de destino, cuya longitud debe ser mayor que 0 y menor que 1025.
- content
- String
- contentType
- ContentType
El valor predeterminado es ContentType.PlainText.
Devoluciones
Si Response se ejecuta correctamente.
Se aplica a
SendToGroup(String, RequestContent, ContentType, IEnumerable<String>, RequestContext)
- Source:
- WebPubSubServiceClient.cs
Enviar contenido dentro del cuerpo de la solicitud a un grupo de conexiones.
public virtual Azure.Response SendToGroup (string group, Azure.Core.RequestContent content, Azure.Core.ContentType contentType, System.Collections.Generic.IEnumerable<string> excluded, Azure.RequestContext context);
abstract member SendToGroup : string * Azure.Core.RequestContent * Azure.Core.ContentType * seq<string> * Azure.RequestContext -> Azure.Response
override this.SendToGroup : string * Azure.Core.RequestContent * Azure.Core.ContentType * seq<string> * Azure.RequestContext -> Azure.Response
Public Overridable Function SendToGroup (group As String, content As RequestContent, contentType As ContentType, excluded As IEnumerable(Of String), context As RequestContext) As Response
Parámetros
- group
- String
Nombre del grupo de destino, cuya longitud debe ser mayor que 0 y menor que 1025.
- content
- RequestContent
Contenido que se va a enviar como el cuerpo de la solicitud. Los detalles del esquema del cuerpo de la solicitud se encuentran en la sección Comentarios a continuación.
- contentType
- ContentType
Cargue el tipo de archivo. Valores permitidos: "application/json" | "application/octet-stream" | "text/plain".
- excluded
- IEnumerable<String>
Identificadores de conexión excluidos.
- context
- RequestContext
Contexto de solicitud, que puede invalidar los comportamientos predeterminados de la canalización de cliente por llamada.
Devoluciones
Respuesta devuelta desde el servicio.
Excepciones
group
o content
es null.
group
es una cadena vacía y se espera que no esté vacía.
El servicio devolvió un código de estado no correcto.
Ejemplos
En este ejemplo se muestra cómo llamar a SendToGroup con los parámetros necesarios y el contenido de la solicitud.
var client = new WebPubSubServiceClient("<https://my-service.azure.com>", "<hub>");
var data = File.OpenRead("<filePath>");
Response response = client.SendToGroup("<group>", RequestContent.Create(data), ContentType.ApplicationOctetStream);
Console.WriteLine(response.Status);
En este ejemplo se muestra cómo llamar a SendToGroup con todos los parámetros y el contenido de la solicitud.
var client = new WebPubSubServiceClient("<https://my-service.azure.com>", "<hub>");
var data = File.OpenRead("<filePath>");
Response response = client.SendToGroup("<group>", RequestContent.Create(data), ContentType.ApplicationOctetStream, new String[]{"<excluded>"});
Console.WriteLine(response.Status);
Comentarios
Esquema para Response Error
:
{
code: string,
message: string,
target: string,
details: [ErrorDetail],
inner: {
code: string,
inner: InnerError
}
}
Se aplica a
SendToGroup(String, RequestContent, ContentType, IEnumerable<String>, String, RequestContext)
- Source:
- WebPubSubServiceClient.cs
Enviar contenido dentro del cuerpo de la solicitud a un grupo de conexiones.
public virtual Azure.Response SendToGroup (string group, Azure.Core.RequestContent content, Azure.Core.ContentType contentType, System.Collections.Generic.IEnumerable<string> excluded = default, string filter = default, Azure.RequestContext context = default);
abstract member SendToGroup : string * Azure.Core.RequestContent * Azure.Core.ContentType * seq<string> * string * Azure.RequestContext -> Azure.Response
override this.SendToGroup : string * Azure.Core.RequestContent * Azure.Core.ContentType * seq<string> * string * Azure.RequestContext -> Azure.Response
Public Overridable Function SendToGroup (group As String, content As RequestContent, contentType As ContentType, Optional excluded As IEnumerable(Of String) = Nothing, Optional filter As String = Nothing, Optional context As RequestContext = Nothing) As Response
Parámetros
- group
- String
Nombre del grupo de destino, cuya longitud debe ser mayor que 0 y menor que 1025.
- content
- RequestContent
Contenido que se va a enviar como el cuerpo de la solicitud. Los detalles del esquema del cuerpo de la solicitud se encuentran en la sección Comentarios a continuación.
- contentType
- ContentType
Cargue el tipo de archivo. Valores permitidos: "application/json" | "application/octet-stream" | "text/plain".
- excluded
- IEnumerable<String>
Identificadores de conexión excluidos.
- filter
- String
Siguiendo la sintaxis de filtro de OData para filtrar los suscriptores que reciben los mensajes.
- context
- RequestContext
Contexto de solicitud, que puede invalidar los comportamientos predeterminados de la canalización de cliente por llamada.
Devoluciones
Respuesta devuelta desde el servicio.
Excepciones
group
o content
es null.
group
es una cadena vacía y se espera que no esté vacía.
El servicio devolvió un código de estado no correcto.
Ejemplos
En este ejemplo se muestra cómo llamar a SendToGroup con los parámetros necesarios y el contenido de la solicitud.
var client = new WebPubSubServiceClient("<https://my-service.azure.com>", "<hub>");
var data = File.OpenRead("<filePath>");
Response response = client.SendToGroup("<group>", RequestContent.Create(data), ContentType.ApplicationOctetStream);
Console.WriteLine(response.Status);
En este ejemplo se muestra cómo llamar a SendToGroup con todos los parámetros y el contenido de la solicitud.
var client = new WebPubSubServiceClient("<https://my-service.azure.com>", "<hub>");
var data = File.OpenRead("<filePath>");
Response response = client.SendToGroup("<group>", RequestContent.Create(data), ContentType.ApplicationOctetStream, new String[]{"<excluded>"}, "<filter>");
Console.WriteLine(response.Status);
Se aplica a
Azure SDK for .NET