0
Good morning Everybody. I’m brand new in PHP and need a help with an api implementation.
I basically have a midleware that does a get or post on a third party’s api. Then, a user gets a get at a url that he donated to him and he gets back the guy’s api. However, I needed to make a move so that even the post is through a get call.
An example:
public function ProductVariations($level){
$this->get("api/catalog_system/pub/products/variations/".$level[0]);
return $this->result();
}
And my Route :
$route->get("productVariations", "Produto@ProductVariations");
The same goes for the Post of my app:
$route->get("createuser", "User@createUser");
--
public function createUser(){
$this->post("api/license-manager/users", [
"email" => "[email protected]",
"name" => "Fabio Teste"
]);
return $this->result();
}
When I enter the parameters directly, absolute success. But I cannot pass this body via post $. post(url, [{xxx xxx}]).
How to make my post receive the body as a variable or similar.
Vlwww
Tried to declare the vector before putting in the body?
– adventistaam