Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.79 KB

File metadata and controls

34 lines (25 loc) · 1.79 KB

ResponseOptions

Namespace: SpawnDev.SpawnJS.JSObjects
Source: JSObjects/ResponseOptions.cs
MDN Reference: ResponseOptions on MDN

An options object containing settings for the response, including the status code, status text, and headers. https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#options https://developer.mozilla.org/en-US/docs/Web/API/Response/json_static#options

Properties

Property Type Access Description
ResponseOptions class get An options object containing settings for the response, including the status code, status text, and headers. https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#options https://developer.mozilla.org/en-US/docs/Web/API/Response/json_static#options
StatusText string? get
Headers Union<Dictionary<string, string>, Headers>? get

Examples

SpawnDev.SpawnJS Mapping Note: The JavaScript examples below show the standard Web API usage. In SpawnDev.SpawnJS, the same API is available with C# conventions:

  • Properties and methods use PascalCase (e.g., readyState becomes ReadyState)
  • Events use ActionEvent with +=/-= (e.g., addEventListener("click", fn) becomes OnClick += handler)
  • Async methods return Task<T> instead of Promise<T>
  • Objects should be disposed with using statements
  • Access via JS.Get<ResponseOptions>(...) or constructor new ResponseOptions(...)
const myBlob = new Blob();
const myOptions = { status: 200, statusText: "SuperSmashingGreat!" };
const myResponse = new Response(myBlob, myOptions);

See full example on MDN