forked from lix-project/hydra
api-test.t: set a default method
This commit is contained in:
parent
832fa8c73d
commit
6b2f0a9fe1
|
@ -42,7 +42,7 @@ sub request_json {
|
||||||
$req->uri("http://localhost$opts->{uri}");
|
$req->uri("http://localhost$opts->{uri}");
|
||||||
$req->header(Accept => "application/json");
|
$req->header(Accept => "application/json");
|
||||||
$req->header(Content_Type => "application/json");
|
$req->header(Content_Type => "application/json");
|
||||||
$req->header(Origin => "http://localhost/") if $opts->{method} eq "POST";
|
$req->header(Origin => "http://localhost/") if ($opts->{method} // "") eq "POST";
|
||||||
$req->header(Cookie => $cookie);
|
$req->header(Cookie => $cookie);
|
||||||
|
|
||||||
$req->content(encode_json($opts->{data})) if defined $opts->{data};
|
$req->content(encode_json($opts->{data})) if defined $opts->{data};
|
||||||
|
|
Loading…
Reference in a new issue