Skip to content

Instantly share code, notes, and snippets.

View ramondomiingos's full-sized avatar
🎯
Focusing

Ramon Domingos ramondomiingos

🎯
Focusing
View GitHub Profile
@renatomb
renatomb / curl_sample_post.sh
Created November 8, 2018 18:36
Exemplo de uso de CURL via linha de comando linux
#Exemplo de CURL preenchendo campos de formulário com -F
curl -X POST -F 'tipo_cnpj=dest' -F 'txtCnpj=99999999999’ -F 'tipo_pesquisa=nf' -F 'txtNumDoc=99999’ http://transportadora.local/jamef/ocorrenciaViagem.do
#Exemplo de CURL enviando conteúdo em json e modificando headers
curl --request POST "http://interno.local/json_decode.php" --header "Content-Type: application/json" --header "MerchantId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" --header "MerchantKey: 0123456789012345678901234567890123456789" --header "RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" --data '{"MerchantOrderId":"2014111703","Customer":{"Name":"Comprador crédito simples"},"Payment":{"Type":"CreditCard","Amount":15700,"Installments":1,"SoftDescriptor":"123456789ABCD","CreditCard":{"CardNumber":"4500000000000001”,”Holder":"Teste Holder","ExpirationDate":"12/2030","SecurityCode":"123","Brand":"Visa"}}}' --verbose
curl --request POST "http://sandbox.local/try_json/" --header "Content-Type: application/json" --header "DEVICE_ID: 012345678