diff --git a/README.md b/README.md index 2477a90..6acad23 100644 --- a/README.md +++ b/README.md @@ -898,27 +898,21 @@ component { .initWith( baseUrl = "https://swapi.co/api" ); - } - - function afterAspectsLoad(){ - // Map Bindings below - map( "GitHubClient" ) + + map( "GitHubClient" ) .to( "hyper.models.HyperBuilder" ) .asSingleton() .initWith( baseUrl = "https://api.github.com", headers = { - "Content-Type" : "application/json", // If you map to a builder with headers - make sure you set your Content-Type if desired - "Authorization" = getColdBox().getSetting( "SWAPI_TOKEN" ) + "Authorization" = getColdBox().getUtil().getSystemSetting( "SWAPI_TOKEN" ) } ); - } + } } ``` -Note: If you are mapping a builder and use the `initWith( headers = {... } )`, these headers will overwrite the default headers you get with a HyperRequest so you might see some inconsistencies. A hyperRequest defaults the headers to `"Content-Type" : "application/json"`, so if you want to set a content-type, please include that in your headers struct, like above. - You can also set or change the defaults by either passing the key / value pairs in to the `init` method or by calling the appropriate `HyperRequest` method on the `HyperBuilder.defaults` property. ```js @@ -1065,4 +1059,4 @@ Hyper announces two interception points you can listen to in your ColdBox applic `onHyperRequest` receives a struct with a `request` key as the data. -`onHyperResponse` receives a struct with a `response` key as the data. +`onHyperResponse` receives a struct with a `response` key as the data. \ No newline at end of file diff --git a/models/HyperRequest.cfc b/models/HyperRequest.cfc index ed9f836..dedc9ed 100644 --- a/models/HyperRequest.cfc +++ b/models/HyperRequest.cfc @@ -931,6 +931,7 @@ component accessors="true" { req.setBaseUrl( variables.baseUrl ); req.setUrl( variables.url ); req.setResolveUrls( variables.resolveUrls ); + req.setEncodeUrl( variables.encodeUrl ); req.setMethod( variables.method ); req.setUsername( variables.username ); req.setPassword( variables.password ); diff --git a/tests/resources/ModuleIntegrationSpec.cfc b/tests/resources/ModuleIntegrationSpec.cfc index 5ad3525..37e0f2e 100644 --- a/tests/resources/ModuleIntegrationSpec.cfc +++ b/tests/resources/ModuleIntegrationSpec.cfc @@ -1,8 +1,10 @@ component extends="coldbox.system.testing.BaseTestCase" { + this.unloadColdBox = false; + function beforeAll() { super.beforeAll(); - + getController().getModuleService() .registerAndActivateModule( "hyper", "testingModuleRoot" ); }