Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Dni jne json #23

Merged
merged 13 commits into from
Oct 19, 2019
Merged

Dni jne json #23

merged 13 commits into from
Oct 19, 2019

Conversation

brianpando
Copy link
Contributor

Codigo para consultar mediante JNE JSON mediante CURL.

@giansalex
Copy link
Owner

giansalex commented Oct 17, 2019

Hola @brianpando, gracias! por la contribución, veo que varias cosas del CI se han caido.
Acerca del uso de curl, se podría seguir usando el httpclient implementado en este repositorio, creo que podría funcionar de esta forma.

$json = $this->client->post($url, json_encode(['CODDNI' => $dni], [
 'Content-Type' => 'application/json;chartset=utf-8',
 'Requestverificationtoken' => '30OB7qfO2MmL2Kcr1z4S0ttQcQpxH9pDUlZnkJPVgUhZOGBuSbGU4qM83JcSu7DZpZw-IIIfaDZgZ4vDbwE5-L9EPoBIHOOC1aSPi4FS_Sc1:clDOiaq7mKcLTK9YBVGt2R3spEU8LhtXEe_n5VG5VLPfG9UkAQfjL_WT9ZDmCCqtJypoTD26ikncynlMn8fPz_F_Y88WFufli38cUM-24PE1',
]));
$raw = json_decode($json)->data;

Copy link
Owner

@giansalex giansalex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Utilizar HTTP Client implementado.

@brianpando
Copy link
Contributor Author

buen punto!

@brianpando
Copy link
Contributor Author

Hola, cambie el codigo para usarlo de la forma que comentas, funciona bien, pero no se como resolver para el async phpreact. ¿Como pasas el parametro de DNI via POST con esa libreria?

Copy link
Owner

@giansalex giansalex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gracias @brianpando, agregue la parte que faltaba

@giansalex giansalex merged commit 48d00e7 into giansalex:master Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants