Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 53 additions & 125 deletions dotnet/docs/api/class-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,57 +43,6 @@ await Request.AllHeadersAsync();

---

### BodyAsync {#request-body}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>request.BodyAsync</x-search>

The request body, if present.

**Usage**

```csharp
await Request.BodyAsync();
```

**Returns**
- [string]?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-body-return"/><a href="#request-body-return" class="list-anchor">#</a>

---

### BodyBufferAsync {#request-body-buffer}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>request.BodyBufferAsync</x-search>

The request body in a binary form. Returns null if the request has no body.

**Usage**

```csharp
await Request.BodyBufferAsync();
```

**Returns**
- [byte]&#91;&#93;?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-body-buffer-return"/><a href="#request-body-buffer-return" class="list-anchor">#</a>

---

### BodyJSONAsync {#request-body-json}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>request.BodyJSONAsync</x-search>

Returns the request body as a parsed JSON object. If the request `Content-Type` is `application/x-www-form-urlencoded`, this method returns a key/value object parsed from the form data. Otherwise, it parses the body as JSON.

**Usage**

```csharp
await Request.BodyJSONAsync();
```

**Returns**
- [JsonElement]?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-body-json-return"/><a href="#request-body-json-return" class="list-anchor">#</a>

---

### Failure {#request-failure}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.Failure</x-search>
Expand Down Expand Up @@ -239,6 +188,59 @@ Request.Method

---

### PostData {#request-post-data}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.PostData</x-search>

Request's post body, if any.

**Usage**

```csharp
Request.PostData
```

**Returns**
- [string]?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-post-data-return"/><a href="#request-post-data-return" class="list-anchor">#</a>

---

### PostDataBuffer {#request-post-data-buffer}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.PostDataBuffer</x-search>

Request's post body in a binary form, if any.

**Usage**

```csharp
Request.PostDataBuffer
```

**Returns**
- [byte]&#91;&#93;?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-post-data-buffer-return"/><a href="#request-post-data-buffer-return" class="list-anchor">#</a>

---

### PostDataJSON {#request-post-data-json}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.12</font><x-search>request.PostDataJSON</x-search>

Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any.

When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned. Otherwise it will be parsed as JSON.

**Usage**

```csharp
Request.PostDataJSON
```

**Returns**
- [JsonElement]?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-post-data-json-return"/><a href="#request-post-data-json-return" class="list-anchor">#</a>

---

### RedirectedFrom {#request-redirected-from}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.RedirectedFrom</x-search>
Expand Down Expand Up @@ -413,80 +415,6 @@ Request.Url
**Returns**
- [string]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-url-return"/><a href="#request-url-return" class="list-anchor">#</a>

---

## Deprecated

### PostData {#request-post-data}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.PostData</x-search>

:::warning[Discouraged]

Use [Request.BodyAsync()](/api/class-request.mdx#request-body) instead.

:::


The request body, if present.

**Usage**

```csharp
Request.PostData
```

**Returns**
- [string]?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-post-data-return"/><a href="#request-post-data-return" class="list-anchor">#</a>

---

### PostDataBuffer {#request-post-data-buffer}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.PostDataBuffer</x-search>

:::warning[Discouraged]

Use [Request.BodyBufferAsync()](/api/class-request.mdx#request-body-buffer) instead.

:::


The request body in a binary form. Returns null if the request has no body.

**Usage**

```csharp
Request.PostDataBuffer
```

**Returns**
- [byte]&#91;&#93;?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-post-data-buffer-return"/><a href="#request-post-data-buffer-return" class="list-anchor">#</a>

---

### PostDataJSON {#request-post-data-json}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.12</font><x-search>request.PostDataJSON</x-search>

:::warning[Discouraged]

Use [Request.BodyJSONAsync()](/api/class-request.mdx#request-body-json) instead.

:::


Returns the request body as a parsed JSON object. If the request `Content-Type` is `application/x-www-form-urlencoded`, this method returns a key/value object parsed from the form data. Otherwise, it parses the body as JSON.

**Usage**

```csharp
Request.PostDataJSON
```

**Returns**
- [JsonElement]?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-post-data-json-return"/><a href="#request-post-data-json-return" class="list-anchor">#</a>


[APIRequest]: /api/class-apirequest.mdx "APIRequest"
[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext"
Expand Down
Binary file added images/cft-logo-change.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/speedboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
118 changes: 34 additions & 84 deletions java/docs/api/class-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,40 +43,6 @@ Request.allHeaders();

---

### body {#request-body}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>request.body</x-search>

The request body, if present.

**Usage**

```java
Request.body();
```

**Returns**
- [null] | [String]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-body-return"/><a href="#request-body-return" class="list-anchor">#</a>

---

### bodyBuffer {#request-body-buffer}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>request.bodyBuffer</x-search>

The request body in a binary form. Returns null if the request has no body.

**Usage**

```java
Request.bodyBuffer();
```

**Returns**
- [null] | [byte&#91;&#93;]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-body-buffer-return"/><a href="#request-body-buffer-return" class="list-anchor">#</a>

---

### failure {#request-failure}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.failure</x-search>
Expand Down Expand Up @@ -221,6 +187,40 @@ Request.method();

---

### postData {#request-post-data}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.postData</x-search>

Request's post body, if any.

**Usage**

```java
Request.postData();
```

**Returns**
- [null] | [String]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-post-data-return"/><a href="#request-post-data-return" class="list-anchor">#</a>

---

### postDataBuffer {#request-post-data-buffer}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.postDataBuffer</x-search>

Request's post body in a binary form, if any.

**Usage**

```java
Request.postDataBuffer();
```

**Returns**
- [null] | [byte&#91;&#93;]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-post-data-buffer-return"/><a href="#request-post-data-buffer-return" class="list-anchor">#</a>

---

### redirectedFrom {#request-redirected-from}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.redirectedFrom</x-search>
Expand Down Expand Up @@ -395,56 +395,6 @@ Request.url();
**Returns**
- [String]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-url-return"/><a href="#request-url-return" class="list-anchor">#</a>

---

## Deprecated

### postData {#request-post-data}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.postData</x-search>

:::warning[Discouraged]

Use [Request.body()](/api/class-request.mdx#request-body) instead.

:::


The request body, if present.

**Usage**

```java
Request.postData();
```

**Returns**
- [null] | [String]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-post-data-return"/><a href="#request-post-data-return" class="list-anchor">#</a>

---

### postDataBuffer {#request-post-data-buffer}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.postDataBuffer</x-search>

:::warning[Discouraged]

Use [Request.bodyBuffer()](/api/class-request.mdx#request-body-buffer) instead.

:::


The request body in a binary form. Returns null if the request has no body.

**Usage**

```java
Request.postDataBuffer();
```

**Returns**
- [null] | [byte&#91;&#93;]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-post-data-buffer-return"/><a href="#request-post-data-buffer-return" class="list-anchor">#</a>


[APIRequest]: /api/class-apirequest.mdx "APIRequest"
[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext"
Expand Down
Loading