Skip to content

Add supporting baseUrl part in request #342

@dilook

Description

@dilook

Is your feature request related to a problem? Please describe.
I'd like to be able to set base part of url for easy testing with unirest

Describe the solution you'd like
Add config to set base url part, smth like that:

@BeforeMethod
void setUp() {
    Unirest.config().setDefaultBaseUrl("http://localhost/api/v1")
}

@Test
void testForMethod1() {
    Unirest.get("method1").asString()
...
}

void testForMethod2() {
    Unirest.get("method2").asString()
...
}

Describe alternatives you've considered
Now I'm everytime write full path in each test:

@Test
void testForMethod1() {
    Unirest.get("http://localhost/api/v1/method1").asString()
...
}

void testForMethod2() {
    Unirest.get("http://localhost/api/v1/method2").asString()
...
}

Metadata

Metadata

Assignees

Labels

Feature RequestValid feature request to add to the backlog

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions