1JSON::RPC::Common::MarsUhsaelr::CHoTnTtPr(i3b)uted PerlJDSoOcNu:m:eRnPtCa:t:iCoonmmon::Marshal::HTTP(3)
2
3
4

NAME

6       JSON::RPC::Common::Marshal::HTTP - Convert HTTP::Request and
7       HTTP::Response to/from JSON::RPC::Common calls and returns.
8

VERSION

10       version 0.11
11

SYNOPSIS

13               use JSON::RPC::Common::Marshal::HTTP;
14
15               my $m = JSON::RPC::Common::Marshal::HTTP->new;
16
17               my $call = $m->request_to_call($http_request);
18
19               my $res = $call->call($object);
20
21               my $http_response = $m->result_to_response($res);
22

DESCRIPTION

24       This object provides marshalling routines to convert calls and returns
25       to and from HTTP::Request and HTTP::Response objects.
26

ATTRIBUTES

28       prefer_get
29           When encoding a call into a request, prefer GET.
30
31           Not reccomended.
32
33       rest_style_methods
34           When encoding a GET request, use REST style URI formatting (the
35           method is part of the path, not a parameter).
36
37       prefer_encoded_get
38           When set and a "params" param exists, decode it as Base 64 encoded
39           JSON and use that as the parameters instead of the query
40           parameters.
41
42           See <http://json-rpc.googlegroups.com/web/json-rpc-over-http.html>.
43
44       user_agent
45           Defaults to the marshal object's class name and the
46           JSON::RPC::Common version number.
47
48       content_type
49       accept_content_type
50       content_types
51       accept_content_types
52           When explicitly set these are the values of the "Content-Type" and
53           "Accept" headers to set.
54
55           Otherwise they will default to "application/json" with
56           calls/returns version 1.0 and 1.1, and "application/json-rpc" with
57           2.0 objects.
58
59       expand
60           Whether or not to use an expander on "GET" style calls.
61
62       expander
63           An instance of CGI::Expand or a look alike to use for "GET"
64           parameter expansion.
65

METHODS

67       request_to_call $http_request
68       post_request_to_call $http_request
69       get_request_to_call $http_request
70           Convert an HTTP::Request to a JSON::RPC::Common::Procedure::Call.
71           Depending on what style of request it is, "request_to_call" will
72           delegate to a variant method.
73
74           Get requests call "uri_to_call"
75
76       uri_to_call $uri
77       encoded_uri_to_call $uri
78       query_uri_to_call $uri
79           Parse a call from a GET request's URI.
80
81       result_to_response $return
82           Convert a JSON::RPC::Common::Procedure::Return to an
83           HTTP::Response.
84
85       write_result_to_response $result, $response
86           Write the result into an object like Catalyst::Response.
87
88       response_to_result $http_response
89       response_to_result_success $http_response
90       response_to_result_error $http_response
91           Convert an HTTP::Response to a
92           JSON::RPC::Common::Procedure::Return.
93
94           A variant is chosen based on "HTTP::Response/is_success".
95
96           The error handler will ensure that "error" in
97           JSON::RPC::Common::Procedure::Return is set.
98
99       call_to_request $call, %args
100       call_to_get_request $call, %args
101       call_to_post_request $call, %args
102       call_to_uri $call, %args
103       call_to_encoded_uri $call, %args
104       call_to_query_uri $call, %args
105           Convert a call to a request (or just a URI for GET requests).
106
107           The arguments can contain a "uri" parameter, which is the base of
108           the request.
109
110           With GET requests, under "rest_style_methods" that URI's path will
111           be appended, and otherwise parameters will just be added.
112
113           POST requests do not cloen and alter the URI.
114
115           If no URI is provided as an argument, "/" will be used.
116
117           The flags "prefer_get" and "encoded" can also be passed to
118           "call_to_request" to alter the type of request to be generated.
119
120       collapse_query_params
121       expand_query_params
122           Only used for query encoded GET requests. If "expand" is set will
123           cause expansion of the params. Otherwise it's a noop.
124
125           Subclass and override to process query params into RPC params as
126           necessary.
127
128           Note that this is NOT in any of the JSON-RPC specs.
129

AUTHOR

131       Yuval Kogman <nothingmuch@woobling.org>
132
134       This software is copyright (c) 2014 by Yuval Kogman and others.
135
136       This is free software; you can redistribute it and/or modify it under
137       the same terms as the Perl 5 programming language system itself.
138
139
140
141perl v5.30.0                      2019-07-26JSON::RPC::Common::Marshal::HTTP(3)
Impressum