memori-client 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85bb70384b9b85bf352c6f82e4b43ea5a077e6c8affc36da7b4c9b56f67bbe86
4
- data.tar.gz: a4012ec355f0f094ffd2642093ea77313d22ae7d78bf4a3bfd3c2f4bb08671f0
3
+ metadata.gz: b54ce0efa13b135e18861657e0a27e3511b732c4743e45cc62ab3269fe2a0efd
4
+ data.tar.gz: 49c44003c4e80665d2d3f836d93fa1a2a404ba2bb9fab173be78e898108b518a
5
5
  SHA512:
6
- metadata.gz: 12579681c1dc49013509c2fb53b486839671630a8e64e6d467715db4f3f0a5e60f9bd4b9f367e106c2d0b55842431476281f5c2008b01e27c755adbd7c883c29
7
- data.tar.gz: 05062f91d4b97235e2584fd959abcb44b18e43b87d6a0bb8d67c2dff6f3e1b2142e71250d50cb6560706187996333afe534783a561e30543169109e4c5929764
6
+ metadata.gz: 19c6421a24b233a1b7f2918b9b310f96611c12b1d9cb3a67a83341c9eafd3dc598fdb962ac83d237298233e38272fd3e4d5dcb96988491ea6cc7d08e115e0961
7
+ data.tar.gz: cba5db29ca9227df52d7047ac51d7011d440a4dfdbd39377cfaf74baf405d0d0caabb07ca2ec4bcb42e923abc266b701b3c37de630fbc5b24f9c8e1462f3d67a
@@ -46,6 +46,16 @@ class MemoriClient::HttpClient
46
46
  handle_response(response, request)
47
47
  end
48
48
 
49
+ def post_file(url, file:)
50
+ url = URI(url)
51
+ https = Net::HTTP.new(url.host, url.port)
52
+ https.use_ssl = url.scheme == 'https'
53
+ request = Net::HTTP::Post.new(url)
54
+ request.set_form([['upload', file]], 'multipart/form-data')
55
+ response = https.request(request)
56
+ handle_response(response, request)
57
+ end
58
+
49
59
  def delete(url, headers: {}, payload: {})
50
60
  url = URI(url)
51
61
  https = Net::HTTP.new(url.host, url.port)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memori-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Lampis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-23 00:00:00.000000000 Z
11
+ date: 2022-12-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Memori Client to interact with Memori backend and engine API
14
14
  email: me@stefanolampis.com