Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #26 from oalders/master
Browse files Browse the repository at this point in the history
Typo fixes
  • Loading branch information
ashb committed Aug 14, 2013
2 parents 7847971 + 387048f commit e106fc5
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions lib/Net/HTTP/Spore.pm
Expand Up @@ -172,27 +172,32 @@ sub _add_methods {
This module is an implementation of the SPORE specification.
To use this client, you need to use or to write a SPORE specification of an API.
A description of the SPORE specification format is available at
To use this client, you need to use or to write a SPORE specification of an
API. A description of the SPORE specification format is available at
L<http://github.com/SPORE/specifications/blob/master/spore_description.pod>
Some specifications for well-known services are available L<http://github.com/SPORE/api-description>.
Some specifications for well-known services are available
L<http://github.com/SPORE/api-description>.
=head2 CLIENT CREATION
First you need to create a client. This can be done using two methods, B<new_from_spec> and B<new_from_string>. The client will read the specification file to create a appropriate methods to interact with the API.
First you need to create a client. This can be done using two methods,
B<new_from_spec> and B<new_from_string>. The client will read the specification
file to create the appropriate methods to interact with the API.
=head2 MIDDLEWARES
It's possible to activate some middlewares to extend the usage of the client. If you're using an API that discuss in JSON, you can enable the middleware L<Net::HTTP::Spore::Middleware::JSON>.
It's possible to activate some middlewares to extend the usage of the client.
If you're using an API that discuss in JSON, you can enable the middleware
L<Net::HTTP::Spore::Middleware::JSON>.
$client->enable('Format::JSON');
or only on some path
$client->enable_if(sub{$_->[0]->path =~ m!/path/to/json/stuff!}, 'Format::JSON');
For very simple middlewares, you can simple pass in an anonymous function
For very simple middlewares, you can simply pass in an anonymous function
$client->enable( sub { my $request = shift; ... } );
Expand All @@ -202,9 +207,9 @@ For very simple middlewares, you can simple pass in an anonymous function
=item new_from_spec($specification_file, %args)
Create and return a L<Net::HTTP::Spore::Core> object, with methods
generated from the specification file. The specification file can
either be a file on disk or a remote URL.
Create and return a L<Net::HTTP::Spore::Core> object, with methods generated
from the specification file. The specification file can either be a file on
disk or a remote URL.
=item new_from_string($specification_string, %args)
Expand All @@ -215,15 +220,19 @@ generated from a JSON specification string.
=head2 TRACING
L<Net::HTTP::Spore> provides a way to trace what's going on when doing a request.
L<Net::HTTP::Spore> provides a way to trace what's going on when doing a
request.
=head3 Enabling Trace
You can enable tracing using the environment variable B<SPORE_TRACE>. You can also enable tracing at construct time by adding B<trace =E<gt> 1> when calling B<new_from_spec>.
You can enable tracing using the environment variable B<SPORE_TRACE>. You can
also enable tracing at construct time by adding B<trace =E<gt> 1> when calling
B<new_from_spec>.
=head3 Trace Output
By default output will be directed to B<STDERR>. You can specify another default output:
By default output will be directed to B<STDERR>. You can specify another
default output:
SPORE_TRACE=1=log.txt
Expand Down

0 comments on commit e106fc5

Please sign in to comment.