xiaohongshu
xiaohongshu
73-network-http-rpc-client
Status: ACTIVE AppliesTo: v10 Type: Policy / Requirements
Full skill instructions
Status: ACTIVE
AppliesTo: v10
Type: Policy / Requirements
Devian 런타임 모듈(단일 모듈)의 Network 기능에 binary→base64 단일 파라미터 POST RPC 클라이언트를 추가한다.
이 SKILL은 정책/요구사항/설계 의도를 정의한다. 구현 및 공개 API는 코드가 정답이며, 예시는 참고용이다.
Namespace 정책: 모든 타입은
namespace Devian단일을 사용한다. 네트워크 계열 public API는Net접두사로 명확화한다.
NetHttpRpcClient: sync API HTTP RPC 클라이언트application/x-www-form-urlencoded 전송Devian C# 런타임은 단일 모듈(
Devian.csproj)로 통합되어 있다. 모든 타입은namespace Devian에 위치한다. (분리된 하위 네임스페이스 금지)
framework-cs/module/Devian/
└── src/
└── Net/
└── Transports/
└── NetHttpRpcClient.cs
| 항목 | 값 |
|---|---|
| Method | POST |
| Content-Type | application/x-www-form-urlencoded; charset=utf-8 |
| Body | {paramName}={urlEncoded(base64(requestBinary))} |
| Default paramName | "p" |
Flow:
requestBinary (byte[])
↓ Convert.ToBase64String()
base64 string
↓ Uri.EscapeDataString()
urlEncoded string
↓ "{paramName}={value}"
form-urlencoded body
| 항목 | 값 |
|---|---|
| Expected | Plain text base64 (no JSON wrapper) |
| Decoding | Convert.FromBase64String(text.Trim()) |
Flow:
HTTP Response Body (text)
↓ Trim()
trimmed base64 string
↓ Convert.FromBase64String()
responseBinary (byte[])
Note: JSON 응답
{"p":"..."}형태는 기본 미지원. 필요시 옵션 확장 가능.
Note: 아래는 이해를 돕기 위한 참고 예시이며, 최종 시그니처/공개 API는 코드가 정답이다.
코드 변경 시 이 문서를 'SSOT'로 맞추지 않는다. 필요하면 문서를 참고 수준으로 갱신한다.
namespace Devian
{
/// <summary>
/// HTTP RPC client with binary→base64 single-param POST protocol.
/// All public APIs are synchronous.
/// </summary>
public sealed class NetHttpRpcClient : IDisposable
{
/// <summary>
/// Creates a new NetHttpRpcClient.
/// </summary>
/// <param name="endpoint">RPC endpoint URI.</param>
/// <param name="paramName">Form parameter name (default: "p").</param>
/// <param name="http">Optional HttpClient (if null, creates internal one).</param>
public NetHttpRpcClient(Uri endpoint, string paramName = "p", HttpClient? http = null);
/// <summary>
/// Synchronously call the RPC endpoint.
/// Throws on HTTP error or decode failure.
/// </summary>
/// <param name="requestBinary">Request payload.</param>
/// <returns>Response payload (decoded from base64).</returns>
public byte[] Call(ReadOnlySpan<byte> requestBinary);
/// <summary>
/// Try to call the RPC endpoint without throwing.
/// </summary>
/// <param name="requestBinary">Request payload.</param>
/// <param name="responseBinary">Response payload if successful.</param>
/// <returns>True if successful, false otherwise.</returns>
public bool TryCall(ReadOnlySpan<byte> requestBinary, out byte[] responseBinary);
/// <summary>
/// Dispose the client (releases HttpClient if owned).
/// </summary>
public void Dispose();
}
}
Call(), TryCall(), Dispose()Task, ValueTask, async 키워드 금지 (public API)SendAsync(...).GetAwaiter().GetResult() 패턴async 도입| 메서드 | 실패 시 |
|---|---|
Call() | 예외 throw (HttpRequestException, FormatException 등) |
TryCall() | false 반환, responseBinary = Array.Empty<byte>() |
using Devian;
// Create client
using var rpc = new NetHttpRpcClient(new Uri("https://api.example.com/rpc"));
// Prepare request
byte[] request = /* serialized protobuf or other binary */;
// Call (throws on error)
byte[] response = rpc.Call(request);
// Or try-call (no throw)
if (rpc.TryCall(request, out var resp))
{
// handle resp
}
netstandard2.1 유지System.Net.Http는 기본 포함)Devian (단일 런타임 모듈, namespace Devian)skills/devian-core/72-network-ws-client/SKILL.mdxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience