Basic import of request body and bearer auth

This commit is contained in:
Gregory Schier
2023-11-05 14:35:25 -08:00
parent c31ae805a6
commit afdbcd0a38
6 changed files with 294 additions and 324 deletions

View File

@@ -1,4 +1,3 @@
export const BODY_TYPE_NONE = null;
export const BODY_TYPE_GRAPHQL = 'graphql';
export const BODY_TYPE_JSON = 'application/json';
@@ -61,8 +60,6 @@ export interface HttpRequest extends BaseModel {
bodyType: string | null;
authentication: Record<string, string | number | boolean | null | undefined>;
authenticationType: string | null;
auth: Record<string, string | number | null>;
authType: string | null;
method: string;
headers: HttpHeader[];
}

View File

@@ -1,8 +1,11 @@
import { invoke } from '@tauri-apps/api';
import type { HttpRequest, HttpResponse } from './models';
export async function sendEphemeralRequest(request: HttpRequest, environmentId: string | null): Promise<HttpResponse> {
export async function sendEphemeralRequest(
request: HttpRequest,
environmentId: string | null,
): Promise<HttpResponse> {
// Remove some things that we don't want to associate
const newRequest = { ...request, id: '', requestId: '', workspaceId: '' };
const newRequest = { ...request };
return invoke('send_ephemeral_request', { request: newRequest, environmentId });
}