Orion3
New Member
Hi everyone,
I'm facing an issue while trying to make an HTTP PUT request in B4A, where I need to send data in XML format to a specific server. Here's the code snippet I'm using:
The problem is that the server seems to reject the PUT request when the Content-Type is set to text/xml. I have tested the same request in other environments (like Postman and Python), and it works fine with the same header.
Additionally, I tried manually building the request using sockets, but I still couldn't get it to work.

I'm facing an issue while trying to make an HTTP PUT request in B4A, where I need to send data in XML format to a specific server. Here's the code snippet I'm using:
code:
Sub EnviarPUT(ipp As String, comando As String)
comando = "<Request><Playback>" & comando & "</Playback></Request>"
Dim url As String = "http://" & ipp & ":" & port & "/api/Replay/%7B%7D/Playback/"
Dim Job As HttpJob
Job.Initialize("RequisicaoPUT", Me)
' Set Content-Type as text/xml
Job.GetRequest.SetContentType("text/xml")
' Send the PUT request with the XML content
Job.PutString(url, comando)
End Sub
The problem is that the server seems to reject the PUT request when the Content-Type is set to text/xml. I have tested the same request in other environments (like Postman and Python), and it works fine with the same header.
Additionally, I tried manually building the request using sockets, but I still couldn't get it to work.
Questions:
- Has anyone faced this issue when working with PUT requests in B4A?
- Is there anything specific I should consider when setting headers for PUT requests in B4A?
- Are there any alternative libraries you recommend for handling HTTP requests with full header customization?
