ideal_postcodes 0.1.1 → 1.0.0
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 +4 -4
- data/.travis.yml +6 -0
- data/README.md +295 -42
- data/Rakefile +13 -6
- data/ideal-postcodes-ruby.gemspec +9 -10
- data/lib/idealpostcodes.rb +30 -9
- data/lib/idealpostcodes/address.rb +31 -0
- data/lib/idealpostcodes/key.rb +13 -0
- data/lib/idealpostcodes/postcode.rb +11 -24
- data/lib/idealpostcodes/util.rb +2 -2
- data/lib/idealpostcodes/version.rb +1 -1
- data/spec/addresses_spec.rb +68 -0
- data/spec/idealpostcodes_spec.rb +56 -0
- data/spec/keys_spec.rb +25 -0
- data/spec/postcodes_spec.rb +66 -0
- data/spec/spec_helper.rb +65 -0
- data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_raises_an_exception_if_invalid_key.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_raises_an_exception_if_limit_breached.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_raises_an_exception_if_no_lookups_remaining.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_returns_an_address_for_a_valid_UDPRN.yml +74 -0
- data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_returns_nil_for_an_invalid_UDPRN.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_is_sensitive_to_limit.yml +81 -0
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_is_sensitive_to_page.yml +369 -0
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_raises_an_exception_if_invalid_key.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_raises_an_exception_if_limit_breached.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_raises_an_exception_if_no_lookups_remaining.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_returns_results_in_a_SearchResult_object.yml +273 -0
- data/spec/vcr_cassettes/IdealPostcodes_Key_lookup_details_returns_key_details.yml +62 -0
- data/spec/vcr_cassettes/IdealPostcodes_Key_lookup_returns_the_availability_status_of_a_key_false_key_.yml +45 -0
- data/spec/vcr_cassettes/IdealPostcodes_Key_lookup_returns_the_availability_status_of_a_key_true_key_.yml +45 -0
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_is_sensitive_to_limit_parameter.yml +52 -0
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_is_sensitive_to_radius_parament.yml +133 -0
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_returns_an_array_of_postcodes_and_locations.yml +84 -0
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_returns_an_empty_array_if_no_results_are_found.yml +43 -0
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_raises_an_exception_if_invalid_key.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_raises_an_exception_if_key_has_run_out_of_balance.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_raises_an_exception_if_limit_has_been_reached.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_returns_a_list_of_addresses_for_a_postcode.yml +268 -0
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_returns_an_empty_array_if_postcode_does_not_exist.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_key_available_returns_false_if_key_is_unavailable.yml +45 -0
- data/spec/vcr_cassettes/IdealPostcodes_key_available_returns_true_if_key_is_available.yml +45 -0
- data/spec/vcr_cassettes/IdealPostcodes_key_details_raises_an_exception_if_no_secret_is_provided.yml +45 -0
- data/spec/vcr_cassettes/IdealPostcodes_key_details_returns_key_information.yml +62 -0
- data/spec/vcr_cassettes/IdealPostcodes_request_generates_a_HTTP_request.yml +268 -0
- data/spec/vcr_cassettes/IdealPostcodes_request_raises_authentication_error_if_invalid_key_is_provided.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_request_raises_limit_reached_error_if_a_limit_has_been_breached.yml +42 -0
- data/spec/vcr_cassettes/IdealPostcodes_request_raises_token_exhausted_error_if_key_balance_is_depleted.yml +42 -0
- metadata +96 -39
- data/test/test_helper.rb +0 -77
- data/test/test_ideal_postcodes.rb +0 -78
| @@ -0,0 +1,42 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://localhost:1337/v1/addresses/0?api_key=foo
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ''
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  Accept:
         | 
| 11 | 
            +
                  - '*/*; q=0.5, application/xml'
         | 
| 12 | 
            +
                  Accept-Encoding:
         | 
| 13 | 
            +
                  - gzip, deflate
         | 
| 14 | 
            +
                  User-Agent:
         | 
| 15 | 
            +
                  - Ruby
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 401
         | 
| 19 | 
            +
                  message: Unauthorized
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Access-Control-Allow-Origin:
         | 
| 22 | 
            +
                  - '*'
         | 
| 23 | 
            +
                  Content-Type:
         | 
| 24 | 
            +
                  - application/json; charset=utf-8
         | 
| 25 | 
            +
                  Content-Length:
         | 
| 26 | 
            +
                  - '135'
         | 
| 27 | 
            +
                  Etag:
         | 
| 28 | 
            +
                  - '"-632160061"'
         | 
| 29 | 
            +
                  Date:
         | 
| 30 | 
            +
                  - Fri, 12 Dec 2014 17:40:26 GMT
         | 
| 31 | 
            +
                  Connection:
         | 
| 32 | 
            +
                  - keep-alive
         | 
| 33 | 
            +
                body:
         | 
| 34 | 
            +
                  encoding: UTF-8
         | 
| 35 | 
            +
                  string: |-
         | 
| 36 | 
            +
                    {
         | 
| 37 | 
            +
                      "code": 4010,
         | 
| 38 | 
            +
                      "message": "Invalid Key. For more information see http://ideal-postcodes.co.uk/documentation/response-codes#4010"
         | 
| 39 | 
            +
                    }
         | 
| 40 | 
            +
                http_version: 
         | 
| 41 | 
            +
              recorded_at: Fri, 12 Dec 2014 17:40:26 GMT
         | 
| 42 | 
            +
            recorded_with: VCR 2.9.3
         | 
    
        data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_raises_an_exception_if_limit_breached.yml
    ADDED
    
    | @@ -0,0 +1,42 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://localhost:1337/v1/addresses/-3?api_key=gandhi
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ''
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  Accept:
         | 
| 11 | 
            +
                  - '*/*; q=0.5, application/xml'
         | 
| 12 | 
            +
                  Accept-Encoding:
         | 
| 13 | 
            +
                  - gzip, deflate
         | 
| 14 | 
            +
                  User-Agent:
         | 
| 15 | 
            +
                  - Ruby
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 402
         | 
| 19 | 
            +
                  message: Payment Required
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Access-Control-Allow-Origin:
         | 
| 22 | 
            +
                  - '*'
         | 
| 23 | 
            +
                  Content-Type:
         | 
| 24 | 
            +
                  - application/json; charset=utf-8
         | 
| 25 | 
            +
                  Content-Length:
         | 
| 26 | 
            +
                  - '144'
         | 
| 27 | 
            +
                  Etag:
         | 
| 28 | 
            +
                  - '"1445167850"'
         | 
| 29 | 
            +
                  Date:
         | 
| 30 | 
            +
                  - Fri, 12 Dec 2014 17:40:26 GMT
         | 
| 31 | 
            +
                  Connection:
         | 
| 32 | 
            +
                  - keep-alive
         | 
| 33 | 
            +
                body:
         | 
| 34 | 
            +
                  encoding: UTF-8
         | 
| 35 | 
            +
                  string: |-
         | 
| 36 | 
            +
                    {
         | 
| 37 | 
            +
                      "code": 4021,
         | 
| 38 | 
            +
                      "message": "Lookup Limit Reached. For more information see http://ideal-postcodes.co.uk/documentation/response-codes#4021"
         | 
| 39 | 
            +
                    }
         | 
| 40 | 
            +
                http_version: 
         | 
| 41 | 
            +
              recorded_at: Fri, 12 Dec 2014 17:40:26 GMT
         | 
| 42 | 
            +
            recorded_with: VCR 2.9.3
         | 
| @@ -0,0 +1,42 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://localhost:1337/v1/addresses/-2?api_key=gandhi
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ''
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  Accept:
         | 
| 11 | 
            +
                  - '*/*; q=0.5, application/xml'
         | 
| 12 | 
            +
                  Accept-Encoding:
         | 
| 13 | 
            +
                  - gzip, deflate
         | 
| 14 | 
            +
                  User-Agent:
         | 
| 15 | 
            +
                  - Ruby
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 402
         | 
| 19 | 
            +
                  message: Payment Required
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Access-Control-Allow-Origin:
         | 
| 22 | 
            +
                  - '*'
         | 
| 23 | 
            +
                  Content-Type:
         | 
| 24 | 
            +
                  - application/json; charset=utf-8
         | 
| 25 | 
            +
                  Content-Length:
         | 
| 26 | 
            +
                  - '146'
         | 
| 27 | 
            +
                  Etag:
         | 
| 28 | 
            +
                  - '"1304241290"'
         | 
| 29 | 
            +
                  Date:
         | 
| 30 | 
            +
                  - Fri, 12 Dec 2014 17:40:26 GMT
         | 
| 31 | 
            +
                  Connection:
         | 
| 32 | 
            +
                  - keep-alive
         | 
| 33 | 
            +
                body:
         | 
| 34 | 
            +
                  encoding: UTF-8
         | 
| 35 | 
            +
                  string: |-
         | 
| 36 | 
            +
                    {
         | 
| 37 | 
            +
                      "code": 4020,
         | 
| 38 | 
            +
                      "message": "Token balance depleted. For more information see http://ideal-postcodes.co.uk/documentation/response-codes#4020"
         | 
| 39 | 
            +
                    }
         | 
| 40 | 
            +
                http_version: 
         | 
| 41 | 
            +
              recorded_at: Fri, 12 Dec 2014 17:40:26 GMT
         | 
| 42 | 
            +
            recorded_with: VCR 2.9.3
         | 
    
        data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_returns_an_address_for_a_valid_UDPRN.yml
    ADDED
    
    | @@ -0,0 +1,74 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://localhost:1337/v1/addresses/0?api_key=gandhi
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ''
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  Accept:
         | 
| 11 | 
            +
                  - '*/*; q=0.5, application/xml'
         | 
| 12 | 
            +
                  Accept-Encoding:
         | 
| 13 | 
            +
                  - gzip, deflate
         | 
| 14 | 
            +
                  User-Agent:
         | 
| 15 | 
            +
                  - Ruby
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 200
         | 
| 19 | 
            +
                  message: OK
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Access-Control-Allow-Origin:
         | 
| 22 | 
            +
                  - '*'
         | 
| 23 | 
            +
                  Content-Type:
         | 
| 24 | 
            +
                  - application/json; charset=utf-8
         | 
| 25 | 
            +
                  Content-Length:
         | 
| 26 | 
            +
                  - '911'
         | 
| 27 | 
            +
                  Etag:
         | 
| 28 | 
            +
                  - '"1752222490"'
         | 
| 29 | 
            +
                  Date:
         | 
| 30 | 
            +
                  - Fri, 12 Dec 2014 17:40:26 GMT
         | 
| 31 | 
            +
                  Connection:
         | 
| 32 | 
            +
                  - keep-alive
         | 
| 33 | 
            +
                body:
         | 
| 34 | 
            +
                  encoding: UTF-8
         | 
| 35 | 
            +
                  string: |-
         | 
| 36 | 
            +
                    {
         | 
| 37 | 
            +
                      "result": {
         | 
| 38 | 
            +
                        "postcode": "ID1 1QD",
         | 
| 39 | 
            +
                        "postcode_inward": "1QD",
         | 
| 40 | 
            +
                        "postcode_outward": "ID1",
         | 
| 41 | 
            +
                        "post_town": "LONDON",
         | 
| 42 | 
            +
                        "dependant_locality": "",
         | 
| 43 | 
            +
                        "double_dependant_locality": "",
         | 
| 44 | 
            +
                        "thoroughfare": "Barons Court Road",
         | 
| 45 | 
            +
                        "dependant_thoroughfare": "",
         | 
| 46 | 
            +
                        "building_number": "2",
         | 
| 47 | 
            +
                        "building_name": "",
         | 
| 48 | 
            +
                        "sub_building_name": "",
         | 
| 49 | 
            +
                        "po_box": "",
         | 
| 50 | 
            +
                        "department_name": "",
         | 
| 51 | 
            +
                        "organisation_name": "",
         | 
| 52 | 
            +
                        "udprn": 0,
         | 
| 53 | 
            +
                        "postcode_type": "S",
         | 
| 54 | 
            +
                        "su_organisation_indicator": "",
         | 
| 55 | 
            +
                        "delivery_point_suffix": "1G",
         | 
| 56 | 
            +
                        "line_1": "2 Barons Court Road",
         | 
| 57 | 
            +
                        "line_2": "",
         | 
| 58 | 
            +
                        "line_3": "",
         | 
| 59 | 
            +
                        "premise": "2",
         | 
| 60 | 
            +
                        "country": "England",
         | 
| 61 | 
            +
                        "county": "",
         | 
| 62 | 
            +
                        "district": "Hammersmith and Fulham",
         | 
| 63 | 
            +
                        "ward": "North End",
         | 
| 64 | 
            +
                        "longitude": -0.208644362766368,
         | 
| 65 | 
            +
                        "latitude": 51.4899488390558,
         | 
| 66 | 
            +
                        "eastings": 524466,
         | 
| 67 | 
            +
                        "northings": 178299
         | 
| 68 | 
            +
                      },
         | 
| 69 | 
            +
                      "code": 2000,
         | 
| 70 | 
            +
                      "message": "Success"
         | 
| 71 | 
            +
                    }
         | 
| 72 | 
            +
                http_version: 
         | 
| 73 | 
            +
              recorded_at: Fri, 12 Dec 2014 17:40:26 GMT
         | 
| 74 | 
            +
            recorded_with: VCR 2.9.3
         | 
| @@ -0,0 +1,42 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://localhost:1337/v1/addresses/-1?api_key=gandhi
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ''
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  Accept:
         | 
| 11 | 
            +
                  - '*/*; q=0.5, application/xml'
         | 
| 12 | 
            +
                  Accept-Encoding:
         | 
| 13 | 
            +
                  - gzip, deflate
         | 
| 14 | 
            +
                  User-Agent:
         | 
| 15 | 
            +
                  - Ruby
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 404
         | 
| 19 | 
            +
                  message: Not Found
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Access-Control-Allow-Origin:
         | 
| 22 | 
            +
                  - '*'
         | 
| 23 | 
            +
                  Content-Type:
         | 
| 24 | 
            +
                  - application/json; charset=utf-8
         | 
| 25 | 
            +
                  Content-Length:
         | 
| 26 | 
            +
                  - '49'
         | 
| 27 | 
            +
                  Etag:
         | 
| 28 | 
            +
                  - '"-1363169990"'
         | 
| 29 | 
            +
                  Date:
         | 
| 30 | 
            +
                  - Fri, 12 Dec 2014 17:40:26 GMT
         | 
| 31 | 
            +
                  Connection:
         | 
| 32 | 
            +
                  - keep-alive
         | 
| 33 | 
            +
                body:
         | 
| 34 | 
            +
                  encoding: UTF-8
         | 
| 35 | 
            +
                  string: |-
         | 
| 36 | 
            +
                    {
         | 
| 37 | 
            +
                      "code": 4044,
         | 
| 38 | 
            +
                      "message": "No UDPRN found"
         | 
| 39 | 
            +
                    }
         | 
| 40 | 
            +
                http_version: 
         | 
| 41 | 
            +
              recorded_at: Fri, 12 Dec 2014 17:40:26 GMT
         | 
| 42 | 
            +
            recorded_with: VCR 2.9.3
         | 
| @@ -0,0 +1,81 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://localhost:1337/v1/addresses?api_key=gandhi&limit=1&query=High%20Street
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ''
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  Accept:
         | 
| 11 | 
            +
                  - '*/*; q=0.5, application/xml'
         | 
| 12 | 
            +
                  Accept-Encoding:
         | 
| 13 | 
            +
                  - gzip, deflate
         | 
| 14 | 
            +
                  User-Agent:
         | 
| 15 | 
            +
                  - Ruby
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 200
         | 
| 19 | 
            +
                  message: OK
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Access-Control-Allow-Origin:
         | 
| 22 | 
            +
                  - '*'
         | 
| 23 | 
            +
                  Content-Type:
         | 
| 24 | 
            +
                  - application/json; charset=utf-8
         | 
| 25 | 
            +
                  Content-Length:
         | 
| 26 | 
            +
                  - '1141'
         | 
| 27 | 
            +
                  Etag:
         | 
| 28 | 
            +
                  - '"447427024"'
         | 
| 29 | 
            +
                  Date:
         | 
| 30 | 
            +
                  - Fri, 12 Dec 2014 17:40:27 GMT
         | 
| 31 | 
            +
                  Connection:
         | 
| 32 | 
            +
                  - keep-alive
         | 
| 33 | 
            +
                body:
         | 
| 34 | 
            +
                  encoding: UTF-8
         | 
| 35 | 
            +
                  string: |-
         | 
| 36 | 
            +
                    {
         | 
| 37 | 
            +
                      "result": {
         | 
| 38 | 
            +
                        "total": 245046,
         | 
| 39 | 
            +
                        "limit": 1,
         | 
| 40 | 
            +
                        "page": 0,
         | 
| 41 | 
            +
                        "hits": [
         | 
| 42 | 
            +
                          {
         | 
| 43 | 
            +
                            "dependant_locality": "",
         | 
| 44 | 
            +
                            "postcode_type": "S",
         | 
| 45 | 
            +
                            "po_box": "",
         | 
| 46 | 
            +
                            "post_town": "RHYL",
         | 
| 47 | 
            +
                            "delivery_point_suffix": "1N",
         | 
| 48 | 
            +
                            "double_dependant_locality": "",
         | 
| 49 | 
            +
                            "su_organisation_indicator": "Y",
         | 
| 50 | 
            +
                            "longitude": -3.48941454288796,
         | 
| 51 | 
            +
                            "department_name": "",
         | 
| 52 | 
            +
                            "district": "Denbighshire",
         | 
| 53 | 
            +
                            "building_name": "66a",
         | 
| 54 | 
            +
                            "dependant_thoroughfare": "",
         | 
| 55 | 
            +
                            "northings": 381371,
         | 
| 56 | 
            +
                            "premise": "66a",
         | 
| 57 | 
            +
                            "postcode_outward": "LL18",
         | 
| 58 | 
            +
                            "postcode_inward": "1UB",
         | 
| 59 | 
            +
                            "sub_building_name": "",
         | 
| 60 | 
            +
                            "eastings": 300883,
         | 
| 61 | 
            +
                            "postcode": "LL18 1UB",
         | 
| 62 | 
            +
                            "country": "Wales",
         | 
| 63 | 
            +
                            "udprn": 13525462,
         | 
| 64 | 
            +
                            "line_3": "",
         | 
| 65 | 
            +
                            "organisation_name": "High Street News",
         | 
| 66 | 
            +
                            "ward": "Rhyl West",
         | 
| 67 | 
            +
                            "county": "",
         | 
| 68 | 
            +
                            "line_1": "High Street News",
         | 
| 69 | 
            +
                            "building_number": " ",
         | 
| 70 | 
            +
                            "thoroughfare": "High Street",
         | 
| 71 | 
            +
                            "line_2": "66a High Street",
         | 
| 72 | 
            +
                            "latitude": 53.3199596875698
         | 
| 73 | 
            +
                          }
         | 
| 74 | 
            +
                        ]
         | 
| 75 | 
            +
                      },
         | 
| 76 | 
            +
                      "code": 2000,
         | 
| 77 | 
            +
                      "message": "Success"
         | 
| 78 | 
            +
                    }
         | 
| 79 | 
            +
                http_version: 
         | 
| 80 | 
            +
              recorded_at: Fri, 12 Dec 2014 17:40:27 GMT
         | 
| 81 | 
            +
            recorded_with: VCR 2.9.3
         | 
| @@ -0,0 +1,369 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://localhost:1337/v1/addresses?api_key=gandhi&page=1&query=High%20Street
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ''
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  Accept:
         | 
| 11 | 
            +
                  - '*/*; q=0.5, application/xml'
         | 
| 12 | 
            +
                  Accept-Encoding:
         | 
| 13 | 
            +
                  - gzip, deflate
         | 
| 14 | 
            +
                  User-Agent:
         | 
| 15 | 
            +
                  - Ruby
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 200
         | 
| 19 | 
            +
                  message: OK
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Access-Control-Allow-Origin:
         | 
| 22 | 
            +
                  - '*'
         | 
| 23 | 
            +
                  Content-Type:
         | 
| 24 | 
            +
                  - application/json; charset=utf-8
         | 
| 25 | 
            +
                  Content-Length:
         | 
| 26 | 
            +
                  - '10382'
         | 
| 27 | 
            +
                  Etag:
         | 
| 28 | 
            +
                  - '"281246662"'
         | 
| 29 | 
            +
                  Date:
         | 
| 30 | 
            +
                  - Fri, 12 Dec 2014 17:40:27 GMT
         | 
| 31 | 
            +
                  Connection:
         | 
| 32 | 
            +
                  - keep-alive
         | 
| 33 | 
            +
                body:
         | 
| 34 | 
            +
                  encoding: UTF-8
         | 
| 35 | 
            +
                  string: |-
         | 
| 36 | 
            +
                    {
         | 
| 37 | 
            +
                      "result": {
         | 
| 38 | 
            +
                        "total": 245046,
         | 
| 39 | 
            +
                        "limit": 10,
         | 
| 40 | 
            +
                        "page": 1,
         | 
| 41 | 
            +
                        "hits": [
         | 
| 42 | 
            +
                          {
         | 
| 43 | 
            +
                            "dependant_locality": "",
         | 
| 44 | 
            +
                            "postcode_type": "S",
         | 
| 45 | 
            +
                            "po_box": "",
         | 
| 46 | 
            +
                            "post_town": "GATESHEAD",
         | 
| 47 | 
            +
                            "delivery_point_suffix": "3B",
         | 
| 48 | 
            +
                            "double_dependant_locality": "",
         | 
| 49 | 
            +
                            "su_organisation_indicator": "Y",
         | 
| 50 | 
            +
                            "longitude": -1.5996299999342,
         | 
| 51 | 
            +
                            "department_name": "",
         | 
| 52 | 
            +
                            "district": "Gateshead",
         | 
| 53 | 
            +
                            "building_name": "",
         | 
| 54 | 
            +
                            "dependant_thoroughfare": "",
         | 
| 55 | 
            +
                            "northings": 562944,
         | 
| 56 | 
            +
                            "premise": "319",
         | 
| 57 | 
            +
                            "postcode_outward": "NE8",
         | 
| 58 | 
            +
                            "postcode_inward": "1EQ",
         | 
| 59 | 
            +
                            "sub_building_name": "",
         | 
| 60 | 
            +
                            "eastings": 425735,
         | 
| 61 | 
            +
                            "postcode": "NE8 1EQ",
         | 
| 62 | 
            +
                            "country": "England",
         | 
| 63 | 
            +
                            "udprn": 27522380,
         | 
| 64 | 
            +
                            "line_3": "",
         | 
| 65 | 
            +
                            "organisation_name": "High Street Tandoori",
         | 
| 66 | 
            +
                            "ward": "Bridges",
         | 
| 67 | 
            +
                            "county": "",
         | 
| 68 | 
            +
                            "line_1": "High Street Tandoori",
         | 
| 69 | 
            +
                            "building_number": "319",
         | 
| 70 | 
            +
                            "thoroughfare": "High Street",
         | 
| 71 | 
            +
                            "line_2": "319 High Street",
         | 
| 72 | 
            +
                            "latitude": 54.9604740808467
         | 
| 73 | 
            +
                          },
         | 
| 74 | 
            +
                          {
         | 
| 75 | 
            +
                            "dependant_locality": "",
         | 
| 76 | 
            +
                            "postcode_type": "S",
         | 
| 77 | 
            +
                            "po_box": "",
         | 
| 78 | 
            +
                            "post_town": "STOKE-ON-TRENT",
         | 
| 79 | 
            +
                            "delivery_point_suffix": "4H",
         | 
| 80 | 
            +
                            "double_dependant_locality": "",
         | 
| 81 | 
            +
                            "su_organisation_indicator": "Y",
         | 
| 82 | 
            +
                            "longitude": -2.21091881456219,
         | 
| 83 | 
            +
                            "department_name": "",
         | 
| 84 | 
            +
                            "district": "Stoke-on-Trent",
         | 
| 85 | 
            +
                            "building_name": "",
         | 
| 86 | 
            +
                            "dependant_thoroughfare": "",
         | 
| 87 | 
            +
                            "northings": 351552,
         | 
| 88 | 
            +
                            "premise": "265",
         | 
| 89 | 
            +
                            "postcode_outward": "ST6",
         | 
| 90 | 
            +
                            "postcode_inward": "5EG",
         | 
| 91 | 
            +
                            "sub_building_name": "",
         | 
| 92 | 
            +
                            "eastings": 385962,
         | 
| 93 | 
            +
                            "postcode": "ST6 5EG",
         | 
| 94 | 
            +
                            "country": "England",
         | 
| 95 | 
            +
                            "udprn": 23592573,
         | 
| 96 | 
            +
                            "line_3": "",
         | 
| 97 | 
            +
                            "organisation_name": "High Street Barbers",
         | 
| 98 | 
            +
                            "ward": "Tunstall",
         | 
| 99 | 
            +
                            "county": "",
         | 
| 100 | 
            +
                            "line_1": "High Street Barbers",
         | 
| 101 | 
            +
                            "building_number": "265",
         | 
| 102 | 
            +
                            "thoroughfare": "High Street",
         | 
| 103 | 
            +
                            "line_2": "265 High Street",
         | 
| 104 | 
            +
                            "latitude": 53.0610314036126
         | 
| 105 | 
            +
                          },
         | 
| 106 | 
            +
                          {
         | 
| 107 | 
            +
                            "dependant_locality": "",
         | 
| 108 | 
            +
                            "postcode_type": "S",
         | 
| 109 | 
            +
                            "po_box": "",
         | 
| 110 | 
            +
                            "post_town": "LANCASTER",
         | 
| 111 | 
            +
                            "delivery_point_suffix": "1P",
         | 
| 112 | 
            +
                            "double_dependant_locality": "",
         | 
| 113 | 
            +
                            "su_organisation_indicator": " ",
         | 
| 114 | 
            +
                            "longitude": -2.80320980765643,
         | 
| 115 | 
            +
                            "department_name": "",
         | 
| 116 | 
            +
                            "district": "Lancaster",
         | 
| 117 | 
            +
                            "building_name": "High Street Cottage",
         | 
| 118 | 
            +
                            "dependant_thoroughfare": "",
         | 
| 119 | 
            +
                            "northings": 461528,
         | 
| 120 | 
            +
                            "premise": "High Street Cottage",
         | 
| 121 | 
            +
                            "postcode_outward": "LA1",
         | 
| 122 | 
            +
                            "postcode_inward": "1LA",
         | 
| 123 | 
            +
                            "sub_building_name": "",
         | 
| 124 | 
            +
                            "eastings": 347506,
         | 
| 125 | 
            +
                            "postcode": "LA1 1LA",
         | 
| 126 | 
            +
                            "country": "England",
         | 
| 127 | 
            +
                            "udprn": 12871258,
         | 
| 128 | 
            +
                            "line_3": "",
         | 
| 129 | 
            +
                            "organisation_name": "",
         | 
| 130 | 
            +
                            "ward": "Duke's",
         | 
| 131 | 
            +
                            "county": "Lancashire",
         | 
| 132 | 
            +
                            "line_1": "High Street Cottage",
         | 
| 133 | 
            +
                            "building_number": " ",
         | 
| 134 | 
            +
                            "thoroughfare": "High Street",
         | 
| 135 | 
            +
                            "line_2": "High Street",
         | 
| 136 | 
            +
                            "latitude": 54.0470356392718
         | 
| 137 | 
            +
                          },
         | 
| 138 | 
            +
                          {
         | 
| 139 | 
            +
                            "dependant_locality": "",
         | 
| 140 | 
            +
                            "postcode_type": "S",
         | 
| 141 | 
            +
                            "po_box": "",
         | 
| 142 | 
            +
                            "post_town": "STOURPORT-ON-SEVERN",
         | 
| 143 | 
            +
                            "delivery_point_suffix": "1S",
         | 
| 144 | 
            +
                            "double_dependant_locality": "",
         | 
| 145 | 
            +
                            "su_organisation_indicator": "Y",
         | 
| 146 | 
            +
                            "longitude": -2.27931256145119,
         | 
| 147 | 
            +
                            "department_name": "",
         | 
| 148 | 
            +
                            "district": "Wyre Forest",
         | 
| 149 | 
            +
                            "building_name": "",
         | 
| 150 | 
            +
                            "dependant_thoroughfare": "",
         | 
| 151 | 
            +
                            "northings": 271336,
         | 
| 152 | 
            +
                            "premise": "22",
         | 
| 153 | 
            +
                            "postcode_outward": "DY13",
         | 
| 154 | 
            +
                            "postcode_inward": "8BJ",
         | 
| 155 | 
            +
                            "sub_building_name": "",
         | 
| 156 | 
            +
                            "eastings": 381067,
         | 
| 157 | 
            +
                            "postcode": "DY13 8BJ",
         | 
| 158 | 
            +
                            "country": "England",
         | 
| 159 | 
            +
                            "udprn": 7798407,
         | 
| 160 | 
            +
                            "line_3": "",
         | 
| 161 | 
            +
                            "organisation_name": "High Street Eatery",
         | 
| 162 | 
            +
                            "ward": "Mitton",
         | 
| 163 | 
            +
                            "county": "Worcestershire",
         | 
| 164 | 
            +
                            "line_1": "High Street Eatery",
         | 
| 165 | 
            +
                            "building_number": "22",
         | 
| 166 | 
            +
                            "thoroughfare": "High Street",
         | 
| 167 | 
            +
                            "line_2": "22 High Street",
         | 
| 168 | 
            +
                            "latitude": 52.339776755703
         | 
| 169 | 
            +
                          },
         | 
| 170 | 
            +
                          {
         | 
| 171 | 
            +
                            "dependant_locality": "",
         | 
| 172 | 
            +
                            "postcode_type": "S",
         | 
| 173 | 
            +
                            "po_box": "",
         | 
| 174 | 
            +
                            "post_town": "RAMSGATE",
         | 
| 175 | 
            +
                            "delivery_point_suffix": "2P",
         | 
| 176 | 
            +
                            "double_dependant_locality": "",
         | 
| 177 | 
            +
                            "su_organisation_indicator": "Y",
         | 
| 178 | 
            +
                            "longitude": 1.41655985776717,
         | 
| 179 | 
            +
                            "department_name": "",
         | 
| 180 | 
            +
                            "district": "Thanet",
         | 
| 181 | 
            +
                            "building_name": "84-86",
         | 
| 182 | 
            +
                            "dependant_thoroughfare": "",
         | 
| 183 | 
            +
                            "northings": 165127,
         | 
| 184 | 
            +
                            "premise": "84-86",
         | 
| 185 | 
            +
                            "postcode_outward": "CT11",
         | 
| 186 | 
            +
                            "postcode_inward": "9RX",
         | 
| 187 | 
            +
                            "sub_building_name": "",
         | 
| 188 | 
            +
                            "eastings": 638079,
         | 
| 189 | 
            +
                            "postcode": "CT11 9RX",
         | 
| 190 | 
            +
                            "country": "England",
         | 
| 191 | 
            +
                            "udprn": 5612648,
         | 
| 192 | 
            +
                            "line_3": "",
         | 
| 193 | 
            +
                            "organisation_name": "High Street Furnishings",
         | 
| 194 | 
            +
                            "ward": "Central Harbour",
         | 
| 195 | 
            +
                            "county": "Kent",
         | 
| 196 | 
            +
                            "line_1": "High Street Furnishings",
         | 
| 197 | 
            +
                            "building_number": " ",
         | 
| 198 | 
            +
                            "thoroughfare": "High Street",
         | 
| 199 | 
            +
                            "line_2": "84-86 High Street",
         | 
| 200 | 
            +
                            "latitude": 51.3353519021575
         | 
| 201 | 
            +
                          },
         | 
| 202 | 
            +
                          {
         | 
| 203 | 
            +
                            "dependant_locality": "",
         | 
| 204 | 
            +
                            "postcode_type": "S",
         | 
| 205 | 
            +
                            "po_box": "",
         | 
| 206 | 
            +
                            "post_town": "CROYDON",
         | 
| 207 | 
            +
                            "delivery_point_suffix": "1H",
         | 
| 208 | 
            +
                            "double_dependant_locality": "",
         | 
| 209 | 
            +
                            "su_organisation_indicator": "Y",
         | 
| 210 | 
            +
                            "longitude": -0.0995056281123368,
         | 
| 211 | 
            +
                            "department_name": "",
         | 
| 212 | 
            +
                            "district": "Croydon",
         | 
| 213 | 
            +
                            "building_name": "",
         | 
| 214 | 
            +
                            "dependant_thoroughfare": "",
         | 
| 215 | 
            +
                            "northings": 164944,
         | 
| 216 | 
            +
                            "premise": "294",
         | 
| 217 | 
            +
                            "postcode_outward": "CR0",
         | 
| 218 | 
            +
                            "postcode_inward": "1NG",
         | 
| 219 | 
            +
                            "sub_building_name": "",
         | 
| 220 | 
            +
                            "eastings": 532394,
         | 
| 221 | 
            +
                            "postcode": "CR0 1NG",
         | 
| 222 | 
            +
                            "country": "England",
         | 
| 223 | 
            +
                            "udprn": 5339130,
         | 
| 224 | 
            +
                            "line_3": "",
         | 
| 225 | 
            +
                            "organisation_name": "High Street Radio",
         | 
| 226 | 
            +
                            "ward": "Fairfield",
         | 
| 227 | 
            +
                            "county": "",
         | 
| 228 | 
            +
                            "line_1": "High Street Radio",
         | 
| 229 | 
            +
                            "building_number": "294",
         | 
| 230 | 
            +
                            "thoroughfare": "High Street",
         | 
| 231 | 
            +
                            "line_2": "294 High Street",
         | 
| 232 | 
            +
                            "latitude": 51.3681335478091
         | 
| 233 | 
            +
                          },
         | 
| 234 | 
            +
                          {
         | 
| 235 | 
            +
                            "dependant_locality": "",
         | 
| 236 | 
            +
                            "postcode_type": "S",
         | 
| 237 | 
            +
                            "po_box": "",
         | 
| 238 | 
            +
                            "post_town": "OXFORD",
         | 
| 239 | 
            +
                            "delivery_point_suffix": "1N",
         | 
| 240 | 
            +
                            "double_dependant_locality": "",
         | 
| 241 | 
            +
                            "su_organisation_indicator": "Y",
         | 
| 242 | 
            +
                            "longitude": -1.25186687752463,
         | 
| 243 | 
            +
                            "department_name": "",
         | 
| 244 | 
            +
                            "district": "Oxford",
         | 
| 245 | 
            +
                            "building_name": "",
         | 
| 246 | 
            +
                            "dependant_thoroughfare": "",
         | 
| 247 | 
            +
                            "northings": 206284,
         | 
| 248 | 
            +
                            "premise": "38",
         | 
| 249 | 
            +
                            "postcode_outward": "OX1",
         | 
| 250 | 
            +
                            "postcode_inward": "4AN",
         | 
| 251 | 
            +
                            "sub_building_name": "",
         | 
| 252 | 
            +
                            "eastings": 451740,
         | 
| 253 | 
            +
                            "postcode": "OX1 4AN",
         | 
| 254 | 
            +
                            "country": "England",
         | 
| 255 | 
            +
                            "udprn": 18046103,
         | 
| 256 | 
            +
                            "line_3": "",
         | 
| 257 | 
            +
                            "organisation_name": "High Street Barbers",
         | 
| 258 | 
            +
                            "ward": "Holywell",
         | 
| 259 | 
            +
                            "county": "Oxfordshire",
         | 
| 260 | 
            +
                            "line_1": "High Street Barbers",
         | 
| 261 | 
            +
                            "building_number": "38",
         | 
| 262 | 
            +
                            "thoroughfare": "High Street",
         | 
| 263 | 
            +
                            "line_2": "38 High Street",
         | 
| 264 | 
            +
                            "latitude": 51.7528688795989
         | 
| 265 | 
            +
                          },
         | 
| 266 | 
            +
                          {
         | 
| 267 | 
            +
                            "dependant_locality": "",
         | 
| 268 | 
            +
                            "postcode_type": "S",
         | 
| 269 | 
            +
                            "po_box": "",
         | 
| 270 | 
            +
                            "post_town": "Stoke-on-Trent",
         | 
| 271 | 
            +
                            "delivery_point_suffix": "1X",
         | 
| 272 | 
            +
                            "double_dependant_locality": "",
         | 
| 273 | 
            +
                            "su_organisation_indicator": "Y",
         | 
| 274 | 
            +
                            "longitude": -2.20991659441027,
         | 
| 275 | 
            +
                            "department_name": "",
         | 
| 276 | 
            +
                            "district": "Stoke-on-Trent",
         | 
| 277 | 
            +
                            "building_name": "94-96",
         | 
| 278 | 
            +
                            "dependant_thoroughfare": "",
         | 
| 279 | 
            +
                            "northings": 351154,
         | 
| 280 | 
            +
                            "premise": "94-96",
         | 
| 281 | 
            +
                            "postcode_outward": "ST6",
         | 
| 282 | 
            +
                            "postcode_inward": "5TJ",
         | 
| 283 | 
            +
                            "sub_building_name": "",
         | 
| 284 | 
            +
                            "eastings": 386028,
         | 
| 285 | 
            +
                            "postcode": "ST6 5TJ",
         | 
| 286 | 
            +
                            "country": "England",
         | 
| 287 | 
            +
                            "udprn": 23595962,
         | 
| 288 | 
            +
                            "line_3": "",
         | 
| 289 | 
            +
                            "organisation_name": "High Street Chippy",
         | 
| 290 | 
            +
                            "ward": "Tunstall",
         | 
| 291 | 
            +
                            "county": "",
         | 
| 292 | 
            +
                            "line_1": "High Street Chippy",
         | 
| 293 | 
            +
                            "building_number": " ",
         | 
| 294 | 
            +
                            "thoroughfare": "High Street",
         | 
| 295 | 
            +
                            "line_2": "94-96 High Street",
         | 
| 296 | 
            +
                            "latitude": 53.0574555183793
         | 
| 297 | 
            +
                          },
         | 
| 298 | 
            +
                          {
         | 
| 299 | 
            +
                            "dependant_locality": "",
         | 
| 300 | 
            +
                            "postcode_type": "S",
         | 
| 301 | 
            +
                            "po_box": "",
         | 
| 302 | 
            +
                            "post_town": "PRESTATYN",
         | 
| 303 | 
            +
                            "delivery_point_suffix": "1Z",
         | 
| 304 | 
            +
                            "double_dependant_locality": "",
         | 
| 305 | 
            +
                            "su_organisation_indicator": "Y",
         | 
| 306 | 
            +
                            "longitude": -3.40445904570847,
         | 
| 307 | 
            +
                            "department_name": "",
         | 
| 308 | 
            +
                            "district": "Denbighshire",
         | 
| 309 | 
            +
                            "building_name": "",
         | 
| 310 | 
            +
                            "dependant_thoroughfare": "",
         | 
| 311 | 
            +
                            "northings": 382944,
         | 
| 312 | 
            +
                            "premise": "73",
         | 
| 313 | 
            +
                            "postcode_outward": "LL19",
         | 
| 314 | 
            +
                            "postcode_inward": "9AH",
         | 
| 315 | 
            +
                            "sub_building_name": "",
         | 
| 316 | 
            +
                            "eastings": 306575,
         | 
| 317 | 
            +
                            "postcode": "LL19 9AH",
         | 
| 318 | 
            +
                            "country": "Wales",
         | 
| 319 | 
            +
                            "udprn": 13549087,
         | 
| 320 | 
            +
                            "line_3": "",
         | 
| 321 | 
            +
                            "organisation_name": "High Street News",
         | 
| 322 | 
            +
                            "ward": "Prestatyn East",
         | 
| 323 | 
            +
                            "county": "",
         | 
| 324 | 
            +
                            "line_1": "High Street News",
         | 
| 325 | 
            +
                            "building_number": "73",
         | 
| 326 | 
            +
                            "thoroughfare": "High Street",
         | 
| 327 | 
            +
                            "line_2": "73 High Street",
         | 
| 328 | 
            +
                            "latitude": 53.335130608282
         | 
| 329 | 
            +
                          },
         | 
| 330 | 
            +
                          {
         | 
| 331 | 
            +
                            "dependant_locality": "Ilchester",
         | 
| 332 | 
            +
                            "postcode_type": "S",
         | 
| 333 | 
            +
                            "po_box": "",
         | 
| 334 | 
            +
                            "post_town": "YEOVIL",
         | 
| 335 | 
            +
                            "delivery_point_suffix": "1P",
         | 
| 336 | 
            +
                            "double_dependant_locality": "",
         | 
| 337 | 
            +
                            "su_organisation_indicator": "Y",
         | 
| 338 | 
            +
                            "longitude": -2.68342119348183,
         | 
| 339 | 
            +
                            "department_name": "",
         | 
| 340 | 
            +
                            "district": "South Somerset",
         | 
| 341 | 
            +
                            "building_name": "",
         | 
| 342 | 
            +
                            "dependant_thoroughfare": "",
         | 
| 343 | 
            +
                            "northings": 122631,
         | 
| 344 | 
            +
                            "premise": "",
         | 
| 345 | 
            +
                            "postcode_outward": "BA22",
         | 
| 346 | 
            +
                            "postcode_inward": "8NH",
         | 
| 347 | 
            +
                            "sub_building_name": "",
         | 
| 348 | 
            +
                            "eastings": 352141,
         | 
| 349 | 
            +
                            "postcode": "BA22 8NH",
         | 
| 350 | 
            +
                            "country": "England",
         | 
| 351 | 
            +
                            "udprn": 1299610,
         | 
| 352 | 
            +
                            "line_3": "Ilchester",
         | 
| 353 | 
            +
                            "organisation_name": "High Street Garage",
         | 
| 354 | 
            +
                            "ward": "Ivelchester",
         | 
| 355 | 
            +
                            "county": "Somerset",
         | 
| 356 | 
            +
                            "line_1": "High Street Garage",
         | 
| 357 | 
            +
                            "building_number": " ",
         | 
| 358 | 
            +
                            "thoroughfare": "High Street",
         | 
| 359 | 
            +
                            "line_2": "High Street",
         | 
| 360 | 
            +
                            "latitude": 51.001071504366
         | 
| 361 | 
            +
                          }
         | 
| 362 | 
            +
                        ]
         | 
| 363 | 
            +
                      },
         | 
| 364 | 
            +
                      "code": 2000,
         | 
| 365 | 
            +
                      "message": "Success"
         | 
| 366 | 
            +
                    }
         | 
| 367 | 
            +
                http_version: 
         | 
| 368 | 
            +
              recorded_at: Fri, 12 Dec 2014 17:40:27 GMT
         | 
| 369 | 
            +
            recorded_with: VCR 2.9.3
         |