Share via


EventGridClient.PublishCloudEvent Method

Definition

Overloads

PublishCloudEvent(String, RequestContent, RequestContext)

[Protocol Method] Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
PublishCloudEvent(String, CloudEvent, Boolean, CancellationToken)

Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error.

PublishCloudEvent(String, RequestContent, RequestContext)

Source:
EventGridClient.cs

[Protocol Method] Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Response PublishCloudEvent (string topicName, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member PublishCloudEvent : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.PublishCloudEvent : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function PublishCloudEvent (topicName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Response

Parameters

topicName
String

Topic Name.

content
RequestContent

The content to send as the body of the request.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Exceptions

topicName or content is null.

topicName is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Applies to

PublishCloudEvent(String, CloudEvent, Boolean, CancellationToken)

Source:
EventGridClient.cs

Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error.

public virtual Azure.Response<Azure.Messaging.EventGrid.Namespaces.PublishResult> PublishCloudEvent (string topicName, Azure.Messaging.CloudEvent event, bool binaryMode = false, System.Threading.CancellationToken cancellationToken = default);
abstract member PublishCloudEvent : string * Azure.Messaging.CloudEvent * bool * System.Threading.CancellationToken -> Azure.Response<Azure.Messaging.EventGrid.Namespaces.PublishResult>
override this.PublishCloudEvent : string * Azure.Messaging.CloudEvent * bool * System.Threading.CancellationToken -> Azure.Response<Azure.Messaging.EventGrid.Namespaces.PublishResult>
Public Overridable Function PublishCloudEvent (topicName As String, event As CloudEvent, Optional binaryMode As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Response(Of PublishResult)

Parameters

topicName
String

Topic Name.

cloudEvent
CloudEvent
binaryMode
Boolean
cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

topicName or cloudEvent is null.

topicName is an empty string, and was expected to be non-empty.

Applies to