Share via


LiveConnectClient.PostAsync(String, IDictionary<String, Object>) method

Performs an asynchronous post operation for a given path and message request body. The post adds a new resource to a collection.

Syntax

public Task<LiveOperationResult> PostAsync(
  string path, 
  IDictionary<String ,Object> body
)
Public Function PostAsync(
  path As String,  
  body As IDictionary<String ,Object> 
) As Task<LiveOperationResult>

Parameters

path

body

Return value

Type: Task<LiveOperationResult>

The LiveOperationResult object with the populated session and result.

Note

Doesn't return a value on the Windows Phone.

Error codes

Name

Meaning

ArgumentNullException

A parameter that was passed in is null.

Remarks

This is a helper function that makes an HTTP POST call to the Live SDK REST reference.

PostAsync automatically uses the access token returned from user sign-in by the constructor, making it possible for a site to omit working directly with access tokens. If the access token cookie is set, PostAsync uses that as well.

Note

Before calling this method, your code must call either the LiveAuthClient.InitializeAsync or LiveAuthClient.LoginAsync method with, at minimum, the corresponding necessary scopes for [downloading | uploading | copying | deleting | reading | moving | creating | updating] the corresponding [data | files | file]. If you don't, the call to this method may fail.

Requirements

Minimum supported client

Windows 8

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8

Namespace

Microsoft.Live

Assembly

Microsoft.Live.dll

See also

LiveConnectClient