REST API
Rozmin Rajwani
2020-05-06
Hi,

We are trying to push data into our database using REST API, but the code has spaces in the values. We have tried puttign a + and also tried UrlEncode but it didnt work. Please advise on how we can go about it, below is the code;


curl -X POST 'http://test:9Series@197.248.85.2:1080/api/1/ORVc?set_field.CustOrdNr=test2033&set_field.OrderClass=LOC&set_field.SerNr=1540000013&set_field.OrdDate=2020-04-23&set_field.CustCode=10271&set_field.ShipAddr0=GUSII MATT&set_field.ShipAddr1=P.O.BOX 3069&set_field.ShipAddr2=KISII&set_field.ShipAddr3=KENYA&set_field.InvAddr0=GUSII MATT&set_field.InvAddr1=P.O.BOX 3069&set_field.InvAddr2=KISII&set_field.InvAddr3=KENYA&set_field.DespatchDate=2020-04-23&set_field.PlanShipDate=2020-04-23&set_field.OrderType=Normal&set_field.CurncyCode=KSHS&set_row_field.0.ArtCode=TPG01088&set_row_field.0.Quant=240&set_row_field.0.Price=375.00'


Thank you,
Rozmin
This answer was correct
Created byJeanay Smith12:53 6 May 2020
Hi Rozmin

Please try the following:

_ replaces the space

in URL format "%20" is the space

For example:
GUSII MATT
GUSII%20MATT


If this is not working then they should try this:
Request header must have these two rows >>>
Content-Type:application/x-www-form-urlencoded
Content-Type:charset=utf-8
This answer was correct
Jeanay Smith
2020-05-06
Hi Rozmin

Please try the following:

_ replaces the space

in URL format "%20" is the space

For example:
GUSII MATT
GUSII%20MATT


If this is not working then they should try this:
Request header must have these two rows >>>
Content-Type:application/x-www-form-urlencoded
Content-Type:charset=utf-8
This answer was useful
Michael Wyeth
2020-05-07
Hi Rozmin

Please can you also check if you are creating the request from PHP or from HAL? If its being created from PHP, you should refer to URLEncoder.encode() function online and see how to implement it.

Best regards,


Hansaworld Support
This thread has been closed for further comments. Please create a new thread
Back to the list
Latest Posts
ConsulBiotech, Investigação e Desenvolvimento, Unipessoal, LDA
Boa tarde, O Standard accounts aparentemente não liga ao servidor CIEDUL e consequentemente as mi...
14:42 24 Oct 2024
HC
Boa tarde, uma vez mais solicitamos resposta à questão colocada. ...
15:13 21 Oct 2024

Supervisionamos regularmente o fórum dentro do horário normal de trabalho e tentamos responder a todas as questões em 24 horas

Pode subscrever notificações para qualquer mensagem neste fórum, seleccionando o ícone 'estrela' no canto superior direito da lista de tópicos. Tem de iniciar sessão para utilizar esta funcionalidade.