http-requestor 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@ A Wrapper around Net/HTTP which allows you to perform HTTP Requests in a simple
20
20
  delete_request = http.delete(path, parameters, headers)
21
21
 
22
22
  # path => for example: "/some_path"
23
- # parameters => this is an optional parameter, if you want to send some parameters alongwith the request, you can pass a hash with
23
+ # parameters => this is an optional parameter, if you want to send some parameters alongwith the request
24
24
  # headers => this is also an optional parameter, you can pass a hash with stringified keys
25
25
 
26
26
  === Get a response right away
@@ -29,7 +29,7 @@ A Wrapper around Net/HTTP which allows you to perform HTTP Requests in a simple
29
29
  # domain => for example: "http://www.some_domain.com"
30
30
  # request_type => GET|POST|PUT|DELETE
31
31
  # path => for example: "/some_path"
32
- # parameters => this is an optional parameter, if you want to send some parameters alongwith the request, you can pass a hash with
32
+ # parameters => this is an optional parameter, if you want to send some parameters alongwith the request
33
33
  # headers => this is also an optional parameter, you can pass a hash with stringified keys
34
34
 
35
35
  OR you can do it the other way
@@ -37,7 +37,7 @@ OR you can do it the other way
37
37
  HTTP::Requestor.request_with_url(url, request_type, data, headers)
38
38
  # url => for example: "http://www.some_domain.com/some_path_value"
39
39
  # request_type => GET|POST|PUT|DELETE
40
- # parameters => this is an optional parameter, if you want to send some parameters alongwith the request, you can pass a hash with
40
+ # parameters => this is an optional parameter, if you want to send some parameters alongwith the request
41
41
  # headers => this is also an optional parameter, you can pass a hash with stringified keys
42
42
 
43
43
  === HTTP Basic Authentication
@@ -136,6 +136,16 @@ class Symbol
136
136
  end
137
137
  end
138
138
 
139
+ class NilClass
140
+ def to_query(key)
141
+ to_s.to_query(key)
142
+ end
143
+
144
+ def to_param
145
+ to_s
146
+ end
147
+ end
148
+
139
149
  class File
140
150
  require 'mime/types'
141
151
  def original_filename
@@ -9,7 +9,7 @@ class HttpRequestorTest < Test::Unit::TestCase
9
9
 
10
10
  def test_should_post_file_properly
11
11
  headers = {"application_api_key" => "bltc5b185cd6884ae87", "application_uid" => "blt2f37284c14b6b453"}
12
- uri = "http://localhost:3000/files.json"
12
+ uri = "http://localhost:3000/v3/classes/files/objects.json"
13
13
  f=File.open("testfile.txt", "w+")
14
14
  f.syswrite("This is testing")
15
15
  f.close
@@ -22,7 +22,7 @@ class HttpRequestorTest < Test::Unit::TestCase
22
22
  http = HTTP::Requestor.new("http://localhost:3000")
23
23
 
24
24
  headers = {"application_api_key" => "bltc5b185cd6884ae87", "application_uid" => "blt2f37284c14b6b453"}
25
- path = "/files.json"
25
+ path = "/v3/classes/files/objects.json"
26
26
  f=File.open("testfile.txt", "w+")
27
27
  f.syswrite("This is testing")
28
28
  f.close
@@ -33,7 +33,7 @@ class HttpRequestorTest < Test::Unit::TestCase
33
33
 
34
34
  def test_should_post_multiple_files
35
35
  headers = {"application_api_key" => "bltc5b185cd6884ae87", "application_uid" => "blt2f37284c14b6b453"}
36
- uri = "http://localhost:3000/multiplefiles.json"
36
+ uri = "http://localhost:3000/v3/classes/multiplefiles/objects.json"
37
37
  f=File.open("testfile.txt", "w+")
38
38
  f.syswrite("This is testing")
39
39
  f.close
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http-requestor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-11-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mime-types
16
- requirement: &28629120 !ruby/object:Gem::Requirement
16
+ requirement: &27297132 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 1.17.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *28629120
24
+ version_requirements: *27297132
25
25
  description: ! " A Wrapper around Net/HTTP which allows you to perform HTTP Requests.\n
26
26
  \ Gives you a simple API interface to send multipart requests.\n"
27
27
  email: rohit0981989@gmail.com