I am trying to send a post request to my server but I keep recieving this error:
HTTP/1.1 400 Bad Request
Date: Sun, 11 Jan 2015 02:16:57 GMT
Server: Apache/2.4.4 (Win64) PHP/5.4.12
Content-Length: 325
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
Request header field is missing ':' separator.<br />
<pre>
cmd=connect&computer=derp\r\n</pre>
</p>
</body></html>
And here is my function for it.
void postReq(SOCKET sock, char *host, char *dat) {
char postDat[5001];
char postData[5001];
sprintf(postDat, "POST /search/api.php HTTP/1.0\r\n"
"Host: %s\r\n"
"Content-type: application/x-www-form-urlencoded\r\n"
"Conent-length: %d\r\n\r\n"
"%s\r\n", host, strlen(dat), dat);
puts(postDat);
send(sock, postDat, strlen(postDat)+1, 0);
}
Why am I recieving this error?
Related
i am trying to send a synchronized request to https server with esp8266 and i am using httpbin.org for testing purpose and i want to synchronize the requests. i mean how to not sending request until the previous is recieved and without using delay?
by comparing code (below) and result (below) you can see that httpsClient.readString() returns empty result from time to time. why? how to explain that? and how to fix that or get around it?
code and result are bellow. please help.
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
//i cut wifi ssid and pswrd declaration to shorten the question
const char *host = "httpbin.org"; //Domain to Server
String path = "/post"; //Path of Server
const int httpsPort = 443; //HTTPS PORT (default: 443)
WiFiClientSecure httpsClient;
String response;
void setup() {
//i cut wifi set up declaration to shorten the question
httpsClient.setInsecure();
if(httpsClient.connect(host, httpsPort)){
Serial.println("Connected to "+String(host));
}else
Serial.println("error connecting");
}
void loop() {
httpsClient.print(String("POST ") + "/response-headers" + " HTTP/1.1\r\n" +
"Host: " + "httpbin.com\r\n"+
"Content-Type: application/x-www-form-urlencoded\r\n" +
"Content-Length: 13\r\n\r\n" +
"say=Hi&to=Sam\r\n");
while(httpsClient.available()) {
response = httpsClient.readStringUntil('\n');
Serial.println(response);
}
Serial.println("---------------------------------------------------------");
}
Result:
---------------------------------------------------------
HTTP/1.1 200 OK
Date: Wed, 26 May 2021 16:20:01 GMT
Content-Type: application/json
Content-Length: 68
Connection: keep-alive
Server: gunicorn/19.9.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
{
"Content-Length": "68",
"Content-Type": "application/json"
}
---------------------------------------------------------
---------------------------------------------------------
HTTP/1.1 200 OK
Date: Wed, 26 May 2021 16:20:01 GMT
Content-Type: application/json
Content-Length: 68
Connection: keep-alive
Server: gunicorn/19.9.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
{
"Content-Length": "68",
"Content-Type": "application/json"
}
HTTP/1.1 200 OK
Date: Wed, 26 May 2021 16:20:01 GMT
Content-Type: application/json
Content-Length: 68
Connection: keep-alive
Server: gunicorn/19.9.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
{
"Content-Length": "68",
"Content-Type": "application/json"
}
---------------------------------------------------------
HTTP/1.1 200 OK
Date: Wed, 26 May 2021 16:20:02 GMT
Content-Type: application/json
Content-Length: 68
Connection: keep-alive
Server: gunicorn/19.9.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
{
"Content-Length": "68",
"Content-Type": "application/json"
}
---------------------------------------------------------
---------------------------------------------------------
---------------------------------------------------------
---------------------------------------------------------
---------------------------------------------------------
---------------------------------------------------------
HTTP/1.1 200 OK
Date: Wed, 26 May 2021 16:26:19 GMT
Content-Type: application/json
Content-Length: 68
Connection: keep-alive
Server: gunicorn/19.9.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
{
"Content-Length": "68",
"Content-Type": "application/json"
}
and so on.....
I have a question, I do not understand why the cookie is not added. I have a frontend and backend on separate servers and at various ports, I hit the backend for a token. In response, he gets it, however, it is not set. Could someone look? Secure and httpOnly is deactivated. On the frontend side I have set withCredentials: true.
On the frontend side:
axios.defaults.withCredentials = true;
axios.post('http://backendhost:8584/login', user).then(response => {
if(response){
this.props.history.push('/home');
}
});
Cors On the api side:
#Bean
CorsConfigurationSource corsConfiguration() {
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
config.setAllowedOrigins(Collections.singletonList("*"));
config.setAllowedMethods(Collections.singletonList("*"));
config.setAllowedHeaders(Collections.singletonList("*"));
UrlBasedCorsConfigurationSource source =
new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", config);
return source;
}
Set cookie on the auth server side:
response.addCookie(generateCookie("session-token", customer.getToken()));
public Cookie generateCookie(String key, String value) {
Cookie cookie = new Cookie(key,value);
cookie.setMaxAge(60 * 60 * 24 * 365);
cookie.setSecure(false);
cookie.setHttpOnly(false);
cookie.setPath("/");
return cookie;
}
And I get it in chrome:
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: http://frontendhost:8080
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json
Date: Tue, 16 Jun 2020 16:30:11 GMT
Expires: 0
Pragma: no-cache
Referrer-Policy: no-referrer
Set-Cookie: session-token=eyJhbGciOiJSUz; Max-Age=31536000; Expires=Wed, 16-Jun-2021 16:30:11 GMT; Path=/
transfer-encoding: chunked
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
I want to send Zendesk ticket to Salesforce.
I have used http target option in extension in zendesk and set the url of my visualforce page (Url: https://c.ap4.visual.force.com/apex/restOutput) and also enabled the Basic Authentication.
When i send the test data from zendesk no logs are generated in salesforce developer console.
The response sent by zendesk after sending the test data.
`
HTTP/1.1 200 OK
Date: Tue, 31 Jul 2018 04:53:09 GMT
Public-Key-Pins-Report-Only: pin-sha256="9n0izTnSRF+W4W4JTq51avSXkWhQB8duS2bxVLfzXsY="; pin-sha256="5kJvNEMw0KjrCAu7eXY5HZdvyCS13BbA0VJG1RSP91w="; pin-sha256="njN4rRG+22dNXAi+yb8e3UMypgzPUPHlv4+foULwl1g="; max-age=86400; includeSubDomains; report-uri="https://calm-dawn-26291.herokuapp.com/hpkp-report/nullm";
Expect-CT: max-age=0; report-uri="https://calm-dawn-26291.herokuapp.com/Expect-CT-report/nullm";
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: upgrade-insecure-requests
X-Robots-Tag: none
Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private
Set-Cookie: BrowserId=EKk-yAZfRfOSD0AHf2etLA;Path=/;Domain=.force.com;Expires=Sat, 29-Sep-2018 04:53:09 GMT;Max-Age=5184000
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding
Content-Encoding: gzip
Transfer-Encoding: chunked
Connection: close
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head></head><body onload="document.forms['workerForm'].submit()">
<form accept-charset="UTF-8" action="https://ap4.salesforce.com/visualforce/session" enctype="application/x-www-form-urlencoded" id="workerForm" method="post" name="workerForm" ><input type="hidden" name="url" id="url" value="https://c.ap4.visual.force.com/apex/restOutput" />
</form>
</body>
</html>
`
My visual page code is as follows:
`
<apex:page controller="myController">
</apex:page>
`
My controller is defined as
`
#RestResource(urlMapping='/restOutput')
global class myController {
public myController(){
System.debug('constructor');
callBack();
}
#HttpPost
global static void callBack()
{
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
System.debug(req.requestBody);
//System.debug(ApexPages.currentPage().getParameters());
}
}
`
Finally i got the solution,
I was making mistake in consuming the api.
To consume the salesforce api, send a post request with authorization header(containing access token),post data. The Request seems similar to.
curl --request POST \
--url https://ap4.lightning.force.com/services/apexrest/restOutput \
--header '<access_token or sessionID' \
--data '{\n"ticket_title":"Workbench Api Request Test",\n"ticket_description":"This is just a test Description",\n"ticket_status":"New",\n"requester_firstname":"Ebizon",\n"requester_lastname":"NetInfo",\n"requester_email":"contact#ebizontek.com"\n}\n'
my draft with big Attachment.
create draft with gapi.
update this draft add some big file.
upload draft rawdata by resumable upload.
when i start a resumable session, it return 404.
Array
(
[url] => https://www.googleapis.com/resumable/upload/gmail/v1/users/me/drafts/r3718017142990379914
[method] => post
[http_header] => Array
(
[0] => Authorization: Bearer ya29.****
[1] => Content-type: application/json
[2] => X-Upload-Content-Type: message/rfc822
)
[response] => HTTP/1.1 200 Tunnel established
HTTP/1.1 404 Not Found
X-GUploader-UploadID: AEnB2Up-CJW9XP4E84DqWjZhI_8-YFgWR47UNNfqGkmM2S5EBf3H5aGOcuwHzLd-4faoKAxd_qgaO5GInDUiJx6uua8JDwj4X0yLamxA--WySFB3ZZxw7YQ
Vary: Origin
Vary: X-Origin
Content-Type: text/html; charset=UTF-8
Content-Length: 9
Date: Fri, 18 Aug 2017 12:48:24 GMT
Server: UploadServer
Alt-Svc: quic=":443"; ma=2592000; v="39,38,37,35"
Not Found
[res_header] => HTTP/1.1 200 Tunnel established
[res_body] => HTTP/1.1 404 Not Found
X-GUploader-UploadID: AEnB2Up-CJW9XP4E84DqWjZhI_8-YFgWR47UNNfqGkmM2S5EBf3H5aGOcuwHzLd-4faoKAxd_qgaO5GInDUiJx6uua8JDwj4X0yLamxA--WySFB3ZZxw7YQ
Vary: Origin
Vary: X-Origin
Content-Type: text/html; charset=UTF-8
Content-Length: 9
Date: Fri, 18 Aug 2017 12:48:24 GMT
Server: UploadServer
Alt-Svc: quic=":443"; ma=2592000; v="39,38,37,35"
Not Found
[errno] => 0
[error] =>
)
so, is the draft can not edited using a resumable upload?
How can I edit a draft with a large attachment?
when you update draft, it must used put.
like:
PUT https://www.googleapis.com/upload/gmail/v1/users/me/drafts/r6052444812129220058
I use libetpan with C code, and I have an email in a .eml file (with 2 attachments):
MIME-Version: 1.0
Received: by 10.76.171.68 with HTTP; Mon, 2 Feb 2015 06:35:10 -0800 (PST)
Bcc: e.chizat+3#klrvi.com
Date: Mon, 2 Feb 2015 15:35:10 +0100
Delivered-To: e.chizat#klervi.com
Message-ID: <CAE2Tr_-3a+VyD4rO0YYdHqrNrPk10oMcL2G4mDLa-sFJXykrdA#mail.gmail.com>
Subject: subject
From: email#email.com
To: email#email.com
Cc: email#email.com
Content-Type: multipart/mixed; boundary=047d7b41436a901ca8050e1bdc67
--047d7b41436a901ca8050e1bdc67
Content-Type: multipart/alternative; boundary=047d7b41436a901ca3050e1bdc65
--047d7b41436a901ca3050e1bdc65
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Some text
--047d7b41436a901ca3050e1bdc65
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div>Some text</div>
--047d7b41436a901ca3050e1bdc65--
--047d7b41436a901ca8050e1bdc67
Content-Type: image/png; name="accueil.png"
Content-Disposition: attachment; filename="accueil.png"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_i5nyjma30
iVBORw0KGgoAAAANSUhEUgAAADoAAAA8CAIAAAC4gD5iAAAACXBIWXMAAAuJAAALiQE3ycutAAAA
B3RJTUUH3QoPCRUWvBfFbAAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAABJr
SURBVGje1VpfjCRHef/tXM35q6PHrjIzR9d553yNbx360BlmwU5uJSz5ECYYAdKZgIQjmcRCJEqk
OAqKUJ78YPGQtzzkAQKKUGIkYuE8YSmgHALEXuJDtxFLri325DpuJtfNbUOVdputL3t1qzz07Hrt
2/Otyf9Wa/ab2Z7u33z1+371fV/VzOgzX84zXVj3/+J15lNf+EZhHQAA7af/l+1Oi3rn/Zu2hxLR
5ymqsZ0fQguf91Gs2KwPRM5SWayU+fA/cf/X2jOjz3z5V/mtQ11YaxLkQzV/PEuNNgmBCJFLz37V
ld4zc1k7DnDMkshW7CIAyufMr+xjsRv7Pl+zVLKzf/ChfOFkns0aSgi7jrz9E8HM3nvnHTMzc+mc
nZRlzYvW5qkpqvA/wF3OUzoxkGc+dCo/lkHgNkeEb7yrnW88QABc462155bLIFRRc/vh/n18QLz9
0TzTteedX3BLu/bzR+hjp7InH3/UHB7wJo8vj8/94Ny3zn7r/D+dX/7R8uVXLvt13xXdhBJsgbcQ
Iwsheod6cTP6X9Rxi3sHSQ8G2RF145ceiPVazO8b3Oa5u+x9czfyQkZPfGD+1G+MuOGz3zn73PPP
2RWrBzo7lmXDjIh848N64MjZMFt430J+PN/xMkd2tbPWQkBKDXAIsJftuRV3oQLEfn18wLzno/vx
6w7WpR8uff7PPv+lv/7SYDD45Mc/+diHH5t/YL7f7/eSnr5Ta63pDirL8jvf/U55rTRvM13qxs2I
LUiS6KKuat6K8kA3HoC+Uyd34AY35b59vC/uzqc488iJ06
--047d7b41436a901ca8050e1bdc67
Content-Type: image/png; name="ajouter.png"
Content-Disposition: attachment; filename="ajouter.png"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_i5nyjr0o1
iVBORw0KGgoAAAANSUhEUgAAAEEAAAAkCAIAAABZrMD7AAAACXBIWXMAAAuJAAALiQE3ycutAAAA
B3RJTUUH3QoPChkHeFQUywAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAN0
SURBVFjD7VgxaBtXGP5SNDyBhhN4uAMV+iABv4DBFyyIDjL4oEPOaLFpoDF06JUOcfHQmA6t6RCU
TE4DIvagolHOYBQPIeehoCXhEki4CxiqQANvaOAOKrg3CPyGGzqckGUlVmq7bSS4b/y5d//7/vf9
//vuzh0cHGDC8QkmHymHlEPK4RCZd0N3d33X54EYu3mlKVmrRO2r+lD83NBsvbvjN5/8Ps5VX7py
8eYX+igtuft8zJXz7g6HOYyhhD64w3QupRxSDmfm4NxZbt5amhgOVM17Ndur2etfGf0gDwUPo9Ol
zOeyK+VL+Vz2/+NgFikAIaQ5S/vBlerjta3W6VIuXmF2WVdy5D/0GkOwilRKNJ+07bJuMM1tBwC8
mi1jGDfqALSp7M1rJWOaSikdn9/fcWUMZOBt2aIrze8bABo/L7GCsvDjtjlDV8o6gOatRSGk+UPj
yPIXfGPXRYwkxcOnbXmAxXm2/mur5fNTcqBqnqpK6yVvveJ2WTeLNOEw+IL7qxZVFecl13LZ6/OM
AJUH7nEv5J0oFFKdIvVHPu9EADZuWKygbO76VFOuf84iKeuPvN6JXWYA2m+FkPL0WkqE1Nrn7T+j
npyOsmaf5qmq+G/C9VprpfpYxlicZyQzwikEUVcCcF5w5xlnNM8Kiv86bPzmVbZbMoal08ECfXPP
Wb7T9IYKd6JzsIoUgDlDL13QJKDmiME0dz8Y8JJK//6XMYSQ6hTJ57JB94gjOE772pQCQJ9W3S17
MNJDDO+P4Ez9kAgJgDl3WBtTp4McAiESVwyAZKAoBPGhpSGEJEmO7GwAoisB+G/CjZ33yE+evaeT
Q9jc9et7HgBC4P5iW3Ossn2Yr82j9luhn1crX5t5JUsycJ7z/vylqrLxrZnNZcnAQQSdiH2mrF0z
gr+iyo6bLF+4zHgoVIWEHdnm0b82W3vN4Ld7VZF49jokBAbTBh9bqzqtV9ycpaygPHzarmz3Zu7t
B27YkeYsRYz6nt9/fnPP56EoTavsgoYY31Ud5zm3ivSnL0sLRRbJExvn4W8gY7XxT5Z5NVtKGKv1
j/MJUV0+2f0wBGNGs4oMQNARk+qXWEGz5igPxe3jL4GP/09gNOp7XtLiqfdOOYzmQMi47zi5T0dx
WJ6/OOYcrBL9QE/bV3XRhbs/yf/50p5OOZwWfwPhHHSIAc2xrgAAAABJRU5ErkJggg==
--047d7b41436a901ca8050e1bdc67--
My probleme is, when I conditionally display mime->mm_data.mm_single->dt_data.dt_text.dt_data (if this mime part is 'plain/texte') I get :
<div>Some text</div>
--047d7b41436a901ca3050e1bdc65--
--047d7b41436a901ca8050e1bdc67
Content-Type: image/png; name="accueil.png"
Content-Disposition: attachment; filename="accueil.png"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_i5nyjma30
iVBORw0KGgoAAAANSUhEUgAAADoAAAA8CAIAAAC4gD5iAAAACXBIWXMAAAuJAAALiQE3ycutAAAA
B3RJTUUH3QoPCRUWvBfFbAAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAABJr
SURBVGje1VpfjCRHef/tXM35q6PHrjIzR9d553yNbx360BlmwU5uJSz5ECYYAdKZgIQjmcRCJEqk
OAqKUJ78YPGQtzzkAQKKUGIkYuE8YSmgHALEXuJDtxFLri325DpuJtfNbUOVdputL3t1qzz07Hrt
2/Otyf9Wa/ab2Z7u33z1+371fV/VzOgzX84zXVj3/+J15lNf+EZhHQAA7af/l+1Oi3rn/Zu2hxLR
5ymqsZ0fQguf91Gs2KwPRM5SWayU+fA/cf/X2jOjz3z5V/mtQ11YaxLkQzV/PEuNNgmBCJFLz37V
ld4zc1k7DnDMkshW7CIAyufMr+xjsRv7Pl+zVLKzf/ChfOFkns0aSgi7jrz9E8HM3nvnHTMzc+mc
nZRlzYvW5qkpqvA/wF3OUzoxkGc+dCo/lkHgNkeEb7yrnW88QABc462155bLIFRRc/vh/n18QLz9
0TzTteedX3BLu/bzR+hjp7InH3/UHB7wJo8vj8/94Ny3zn7r/D+dX/7R8uVXLvt13xXdhBJsgbcQ
Iwsheod6cTP6X9Rxi3sHSQ8G2RF145ceiPVazO8b3Oa5u+x9czfyQkZPfGD+1G+MuOGz3zn73PPP
2RWrBzo7lmXDjIh848N64MjZMFt430J+PN/xMkd2tbPWQkBKDXAIsJftuRV3oQLEfn18wLzno/vx
6w7WpR8uff7PPv+lv/7SYDD45Mc/+diHH5t/YL7f7/eSnr5Ta63pDirL8jvf/U55rTRvM13qxs2I
LUiS6KKuat6K8kA3HoC+Uyd34AY35b59vC/uzqc488iJ06
--047d7b41436a901ca8050e1bdc67
Content-Type: image/png; name="ajouter.png"
Content-Disposition: attachment; filename="ajouter.png"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_i5nyjr0o1
iVBORw0KGgoAAAANSUhEUgAAAEEAAAAkCAIAAABZrMD7AAAACXBIWXMAAAuJAAALiQE3ycutAAAA
B3RJTUUH3QoPChkHeFQUywAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAN0
SURBVFjD7VgxaBtXGP5SNDyBhhN4uAMV+iABv4DBFyyIDjL4oEPOaLFpoDF06JUOcfHQmA6t6RCU
TE4DIvagolHOYBQPIeehoCXhEki4CxiqQANvaOAOKrg3CPyGGzqckGUlVmq7bSS4b/y5d//7/vf9
//vuzh0cHGDC8QkmHymHlEPK4RCZd0N3d33X54EYu3mlKVmrRO2r+lD83NBsvbvjN5/8Ps5VX7py
8eYX+igtuft8zJXz7g6HOYyhhD64w3QupRxSDmfm4NxZbt5amhgOVM17Ndur2etfGf0gDwUPo9Ol
zOeyK+VL+Vz2/+NgFikAIaQ5S/vBlerjta3W6VIuXmF2WVdy5D/0GkOwilRKNJ+07bJuMM1tBwC8
mi1jGDfqALSp7M1rJWOaSikdn9/fcWUMZOBt2aIrze8bABo/L7GCsvDjtjlDV8o6gOatRSGk+UPj
yPIXfGPXRYwkxcOnbXmAxXm2/mur5fNTcqBqnqpK6yVvveJ2WTeLNOEw+IL7qxZVFecl13LZ6/OM
AJUH7nEv5J0oFFKdIvVHPu9EADZuWKygbO76VFOuf84iKeuPvN6JXWYA2m+FkPL0WkqE1Nrn7T+j
npyOsmaf5qmq+G/C9VprpfpYxlicZyQzwikEUVcCcF5w5xlnNM8Kiv86bPzmVbZbMoal08ECfXPP
Wb7T9IYKd6JzsIoUgDlDL13QJKDmiME0dz8Y8JJK//6XMYSQ6hTJ57JB94gjOE772pQCQJ9W3S17
MNJDDO+P4Ez9kAgJgDl3WBtTp4McAiESVwyAZKAoBPGhpSGEJEmO7GwAoisB+G/CjZ33yE+evaeT
Q9jc9et7HgBC4P5iW3Ossn2Yr82j9luhn1crX5t5JUsycJ7z/vylqrLxrZnNZcnAQQSdiH2mrF0z
gr+iyo6bLF+4zHgoVIWEHdnm0b82W3vN4Ld7VZF49jokBAbTBh9bqzqtV9ycpaygPHzarmz3Zu7t
B27YkeYsRYz6nt9/fnPP56EoTavsgoYY31Ud5zm3ivSnL0sLRRbJExvn4W8gY7XxT5Z5NVtKGKv1
j/MJUV0+2f0wBGNGs4oMQNARk+qXWEGz5igPxe3jL4GP/09gNOp7XtLiqfdOOYzmQMi47zi5T0dx
WJ6/OOYcrBL9QE/bV3XRhbs/yf/50p5OOZwWfwPhHHSIAc2xrgAAAABJRU5ErkJggg==
--047d7b41436a901ca8050e1bdc67--
How can I just get (more or less the Content-* part):
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div>Some text</div>
mime->mm_data.mm_single->dt_data.dt_text.dt_data is the beggining of my text. I have to print it using mime->mm_data.mm_single->dt_data.dt_text.dt_length, the length of my text.