alguien que hable español para que me puedas echar una mano con post json

169 views
Skip to first unread message

Discapacidad cinco

unread,
Nov 30, 2017, 2:50:49 PM11/30/17
to mitappinv...@googlegroups.com
e gustaria contactar con alguien que me pueda dar una ayuda estoy dispuesto a pagar por la ayuda si es necesario  tengo un problema con el post en json para cyclos me da error 500 estoy seguro que me fata algo por aser 
 
esta es la pagina que explica que debo hacer pero lo hago y no funciona


esta es lo que estoy asiendo 




la respuesta es 500 internal server error

si me solucionas ese problema te pago  tengo ya una semana entera asiendo pruebas de mil formas e desintalado el sistema lo e instalado en todas las formas y segun creo es que me fata algo en el método

Taifun

unread,
Nov 30, 2017, 3:13:30 PM11/30/17
to mitappinv...@googlegroups.com
your blocks look fine
well, probably the amount is not a string but a numeric field? so instead of "0.01" try just 0.01
and how did you create your Base64 authorization string? see also here https://puravidaapps.com/filedownload.php#restricted how to do it

EDIT:
are you sure you are using the correct URL?
also what exactly are you trying to do? what is the complete URL?
what happens, if you remove the port number from the URL?

btw. your question is similar to this thread https://groups.google.com/d/msg/mitappinventortest/y9hBe50DFR4/IleLn8upBgAJ 

Taifun


Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

Erich Mönch

unread,
Nov 30, 2017, 4:52:07 PM11/30/17
to MIT App Inventor Forum
Try calling the webservice through a direct POST call. I use Postman software. Then you'll know if it's a problem of your app or inside your server side application.

The tip Taifun gave is also valid. Number usually have the . (DOT) to describe decimals...

Abraham Getzler

unread,
Nov 30, 2017, 4:55:58 PM11/30/17
to MIT App Inventor Forum
Also try changing amount 0,01 to 0.01
(Use decimal point in number instead of comma).

ABG

Discapacidad cinco

unread,
Nov 30, 2017, 5:11:26 PM11/30/17
to MIT App Inventor Forum
gracias por responder mira yo soy nuevo en esto de programar
 no entendí que me quiso decir que hiciera
 si es tan amable y me lo da con un código de ejemplo para yo copiarme del ejemplo 
en cuanto al la publicación que menciono ya la mire y me fue de mucha ayuda par resolver las peticiones Get que me trabajan de maravilla, pero esa publicación habla de hacer un Get y yo necesito hacer es un Post con body en este link explican lo que yo necesito hacer pero mi falta de conocimiento y la la fata de ejemplo ilustrativo no me ayuda



General guidelines

  • Response bodies contains JSON objects. However, it is always good to check the response's Content-type header, as under some errors a distinct response format may be returned (for example, invalid URL or HTTP method can return a regular server error page).
  • Raw dates are normally formatted using the ISO 8601 format.
  • To reduce textual output, empty properties on objects, as well as empty arrays are suppressed from the generated JSON string.
  • The property order on objects is not guaranteed. Anyway, clients shouldn't rely on it.
  • In all services which require a request body object, the following header is required:
Content-Type: application/json
  • All service URLs, except for <cyclos>/rest/general, require an authenticated user. This is done through the regular HTTP Basic authentication, which is sent as a request header:
Authorization: Basic <Base64 encoding of username:password>
  • Services that require a post body object also expect it to be JSON encoded.
  • Handled exceptions also return Content-type: application/json, with an object containing the following properties:
    • error: An error code which can be relied on to find out what caused the problem. Common codes are:
      • NOT_FOUND: An expected data was not found, normally from input identifiers. The details property will contain which data type was not found. Examples are MEMBERACCOUNTTRANSFER, etc.
      • INVALID_ARGUMENT: Some request argument was not of the expected type.
      • PERMISSION_DENIED: Attempt to perform an operation which has been denied by lacking permission for it.
      • INTERNAL_SERVER_ERROR: General, unexpected error. On the server side, a log should be generated with the complete error trace.
      • INACTIVE_TRANSACTION_PASSWORD: If transaction password is required and the authenticated user's transaction password is not active.
      • MISSING_TRANSACTION_PASSWORD: If transaction password is required to perform some operation (like performing a payment) and it was not informed.
      • INVALID_TRANSACTION_PASSWORD: A given transaction password is invalid.
      • BLOCKED_TRANSACTION_PASSWORD: A given transaction password has been blocked by exceeding the maximum allowed tries.
    • details: Optional details about the specific error type.

Available services

The REST services are available under the url <cyclos_root>/rest/. The following services are available:




ServiceURIHTTP methodInputResult
Performs a validation payment from the authenticated member to another member returning crucial information needed to confirm the payment.payments/memberPaymentPOSTRequest body: Object with the following properties:
  • transactionPassword: The transaction password, which might be needed to complete the payment. Whether this is needed depends on the group settings (if the member group uses transaction password) and the REST channel configuration, where only used if credentials is 'Default' (login password + transaction password)
  • toMemberId: Internal identifier for the destination member. Either this or toMemberPrincipal are required.
  • toMemberPrincipal: Principal (username, e-mail, custom field, etc, as configured on the rest channel) for the destination member. Either this or toMemberId are required.
  • amount: Numerical amount for the payment. Required.
  • transferTypeId: Internal identifier for payment transfer type. Optional.
  • currencyId: Internal identifier for payment currency. Optional. If passing in a currency, use either currencyId or currencySymbol.
  • currencySymbol: The symbol for the payment currency. Optional. If passing in a currency, use either currencyId or currencySymbol.
  • installments: Number of installments for this payment. Optional. If empty, will be assumed 1, and processed directly. The interval between installments is one month.
  • firstInstallmentDate: ISO 8601 formatted date for the first installment. Optional. If using multiple installments and the first date was not informed, the first installment will be immediately processed.
  • description: Payment description. Optional. Defaults to the transfer type description.
  • customValues: An array containing objects, each describing a custom field value, with the following properties:
    • internalName: The custom field internal name
    • fieldId: The custom field id
    • possibleValueId: The custom field possible value id
    • value: The custom field value
    • hidden: A boolean flag indicating whether the field value is hidden

The field of a custom field value can be identified passing the internal name (internalName) or field id (fieldId). If the value of a custom field value is an enumerated value it is sufficient to pass the possible value id (possibleValueId), or the enumerated string value in the value parameter.

Object with the following properties:
  • fromMember: Same object as load member by id
  • toMember: Same object as load member by id
  • wouldRequireAuthorization: Boolean flag indicating if the payment would require authorization
  • unitsPattern (deprecated): String value containing the units pattern
  • finalAmount: Numeric. The final payment amount considering fees.
  • formattedFinalAmount: String. The formatted final payment amount considering fees.
  • fees: The applicable payment fees, an array of objects containing the following information:
    • name: name of the fee
    • amount: numeric amount of the fee
    • formattedAmount: formatted amount of the fee
  • transferType: Same object as load transfer type by id
  • customValues: A map keyed by the name of the custom field and the corresponding string value as the value.


Juan Antonio

unread,
Nov 30, 2017, 5:19:40 PM11/30/17
to MIT App Inventor Forum
Hola,

in this page,  difference between POST and GET

Discapacidad cinco

unread,
Nov 30, 2017, 5:24:40 PM11/30/17
to MIT App Inventor Forum
gracia erich me podrías escribir un código de ejemplo de como se aria soy nuevo en esto no tengo experiencia me e guiado por las respuesta que e leído en este mismo foro pero no e conseguido solucionar mi problema ya que lo que aquí se a ofrecido es para el método get y yo necesito usar el método post

en cuanto al  . (punto) la ayuda del programa dice que el método decimal es ,  y que es el software del cartero? que usted menciona en que pruebe con eso y como aria la prueba gracias

Discapacidad cinco

unread,
Nov 30, 2017, 5:57:46 PM11/30/17
to MIT App Inventor Forum
según el post que me menciona agregue el modulo call web1 get al final y me sale el siguiente mensaje


text/html;charset=utf-8405<html><head><title>Apache Tomcat/7.0.56 - Informe de Error</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>Estado HTTP 405 - Request method 'GET' not supported</h1><HR size="1" noshade="noshade"><p><b>type</b> Informe de estado</p><p><b>mensaje</b> <u>Request method 'GET' not supported</u></p><p><b>descripción</b> <u>El método HTTP especificado no está permitido para el recurso requerido.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.56</h3></body></html>


Evan Patton

unread,
Nov 30, 2017, 5:59:29 PM11/30/17
to MIT App Inventor Forum
The error message embedded in that HTML is:

State HTTP 405 - Request method 'GET' not supported

This suggests to me that you should be using the Web1.Post method instead of Web1.Get.

Regards,
Evan

Taifun

unread,
Nov 30, 2017, 6:06:02 PM11/30/17
to MIT App Inventor Forum
now you are sending both, a POST and a GET request to the server... which does not make much sense...
what about answering the questions I asked earlier?

are you sure you are using the correct URL?
also what exactly are you trying to do? what is the complete URL?
what happens, if you remove the port number from the URL?

Taifun

Discapacidad cinco

unread,
Nov 30, 2017, 6:42:04 PM11/30/17
to MIT App Inventor Forum
in this page,  difference between POST and GET

http://kio4.com/appinventor/326A_post_get.htm  en esa pagina esta mal explicado el método Post  es por eso que e pasado dolores de acabes  pero debo agradecer a todos especialmente a  Taifun Bär y a Juan Antonio  ya solucione el problema coloco la solución para que sirva de ayuda


en la cabecera coloque Accept: */* y coloque en ves cde , (coma) . (puntos)



ajunto imagen de como quedo y corrijan el Post donde explican el método Post ya que lo explican mal no debe ir call get en un método Post



Juan Antonio

unread,
Dec 2, 2017, 9:09:38 AM12/2/17
to MIT App Inventor Forum
Mi servidor funciona con GET y POST, por eso no me salió ese error, he cambiado esa información en el tutorial:

Reply all
Reply to author
Forward
0 new messages