Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add request() method #2

Open
thiagofigueiro opened this issue Apr 25, 2017 · 0 comments
Open

Add request() method #2

thiagofigueiro opened this issue Apr 25, 2017 · 0 comments

Comments

@thiagofigueiro
Copy link
Owner

This should return the most common information present in a HTTP request in a consistent manner. E.g.:

fake.request()
{
    scheme: 'http',
    version: '1.1',
    domain: 'www.example.com',
    port: 80,
    file_extension: 'jpg',
    content_type: 'image/jpeg',
    path: '/images/file.jpg',
    url: 'http://www.example.com/images/file.jpg',
}

Variations:

  • scheme: http, https, spdy,
  • version: 1.0, 1.1, 2.0
  • domain: domain_name
  • port: common ports associated with scheme
  • file_extension: choose from mime_type_popular
  • content_type: based on file_extension
  • path: uri_path with file_name and file_extension matching content_type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant