Skip to content

Commit

Permalink
Post Feature Added
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal Web committed Aug 10, 2023
1 parent 23f8816 commit 010e9bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions udsp/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { fetchRequest } from '../fetch.js';
import { UDSP } from '#udsp/base';
import { sendPacket } from '../sendPacket.js';
import { connect } from './connect.js';
import { post } from '../post';
// UNIVERSAL WEB Client Class
export class Client extends UDSP {
constructor(configuration) {
Expand Down Expand Up @@ -324,6 +325,7 @@ export class Client extends UDSP {
}
request = request;
fetch = fetchRequest;
post = post;
processMessage = processMessage;
emit = emit;
onListening = onListening;
Expand Down
15 changes: 15 additions & 0 deletions udsp/post.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {
success, failed, imported, msgSent, info
} from '#logs';
import { promise, construct, isString } from '@universalweb/acid';
imported('Request');
export async function post(url, data, options = {}) {
info(`POST => ${url}`);
options.method = 'post';
const source = {
url,
data,
};
const request = await this.request(source, options);
return request.send();
}

0 comments on commit 010e9bf

Please sign in to comment.